File PlayOnLinux.spec of Package PlayOnLinux
%if 0%{?suse_version} >= 1600
%define pythons python311
%else
%define pythons python3
%endif
%define _sname POL-POM-4
%define _sversion 4.4
%define _name playonlinux
Name: PlayOnLinux
Version: 4.4.0
Release: 0
Summary: Play your Windows games on GNU/Linux
License: GPL-3.0-only
Group: Amusements/Games/Other
URL: https://playonlinux.com
#Source: http://repository.playonlinux.com/%%{name}/%%{version}/%%{name}_%%{version}.tar.gz
#Source: https://github.com/PlayOnLinux/POL-POM-4/archive/%{_sversion}/%{name}-%{version}.tar.gz
Source: %{_sversion}/%{name}-%{version}.tar.xz
Source1: playonlinux.sh
# PATCH-FIX-OPENSUSE PlayOnLinux-desktop.patch
Patch0: %{name}-desktop.patch
# PATCH-FIX-OPENSUSE PlayOnLinux-python-pipes.patch: Fix error "ModuleNotFoundError: No module named 'pipes'", which was removed in python3.13.
Patch1: %{name}-python-pipes.patch
# PATCH-FIX-OPENSUSE PlayOnLinux-fix_media_dir.patch: Fix variable MEDIA_DIR to correct location.
Patch9: %{name}-fix_media_dir.patch
# PATCH-FIX-OPENSUSE PlayOnLinux-https.patch: Fix unencrypted connection to www.playonlinux.com
Patch10: %{name}-https.patch
BuildRequires: fdupes
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
# Not need for build. Only to test if packages are exists.
%if 0%{?suse_version}
BuildRequires: %{python_module base < 3.13}
BuildRequires: %{python_module natsort}
BuildRequires: %{python_module wxPython}
%endif
%if 0%{?fedora_version}
BuildRequires: python3
BuildRequires: python3-natsort
BuildRequires: python3-wxpython4
%endif
%if 0%{?suse_version}
Requires: %{python_flavor}-base < 3.13
Requires: %{python_flavor}-natsort
Requires: %{python_flavor}-wxPython
%endif
%if 0%{?fedora_version}
Requires: python3
Requires: python3-natsort
Requires: python3-wxpython4
%endif
Requires: ImageMagick
Requires: gettext
Requires: icoutils
Requires: jq
Requires: unzip
Requires: wget
Requires: wine
Requires: xterm
BuildArch: noarch
# Remove when p7zip-full is in all products
%if 0%{?suse_version} >= 1500
Requires: p7zip-full
%else
Requires: p7zip
%endif
%description
PlayOnLinux is a piece of software which allows you to easily install and use
numerous games and apps designed to run with Microsoft Windows.
Few games are compatible with GNU/Linux at the moment and it certainly is
a factor preventing the migration to this system.
PlayOnLinux brings a cost-free, accessible and efficient solution to this problem.
%prep
%setup -q -n %{_sname}-%{_sversion}
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 9 -p1
%patch -P 10 -p1
# rpmlint
%if 0%{?suse_version} >= 1600
find . -type f -exec sed -i -e 's|\/usr\/bin\/python3|\/usr\/bin\/python%{python_bin_suffix}|g' {} \;
find . -type f -exec sed -i -e 's|\/usr\/bin\/env python|\/usr\/bin\/python%{python_bin_suffix}|g' {} \;
%else
find . -type f -exec sed -i -e 's|\/usr\/bin\/env python|\/usr\/bin\/python3|g' {} \;
%endif
find . -type f -exec sed -i -e 's|\/usr\/bin\/env bash|\/bin\/bash|g' {} \;
%build
# Nothing to build.
%install
install -Dm 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{_name}
mkdir -p %{buildroot}%{_datadir}/%{_name}/
cp -rf * %{buildroot}%{_datadir}/%{_name}/
# Remove unneeded files.
rm -f %{buildroot}%{_datadir}/%{_name}/{CHANGELOG.md,README.md,LICENCE,TRANSLATORS,python/mainwindow.py.orig}
rm -rf %{buildroot}%{_datadir}/%{_name}/src
for f in bash/read_pc_cd bash/find_python bash/startup_after_server python/setupwindow/gui_server.py \
tests/bash/test-versionlower tests/python/test_versionlower.py; do
chmod +x "%{buildroot}%{_datadir}/%{_name}/$f"
done
install -Dm 0644 etc/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 0644 %{buildroot}%{_datadir}/%{_name}%{_sysconfdir}/%{_name}.png %{buildroot}%{_datadir}/pixmaps/%{_name}.png
install -Dm 0644 %{buildroot}%{_datadir}/%{_name}%{_sysconfdir}/%{name}.directory %{buildroot}%{_datadir}/desktop-directories/%{name}.directory
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif
%fdupes %{buildroot}%{_datadir}
%find_lang pol
%files -f pol.lang
%doc CHANGELOG.md README.md TRANSLATORS
%license LICENCE
%{_bindir}/%{_name}
%dir %{_datadir}/desktop-directories
%{_datadir}/playonlinux/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{_name}.png
%{_datadir}/desktop-directories/%{name}.directory
%changelog