From 13b91c8b64c84daf346c2f9e0bc1377202ed3ae2 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Apr 14 2018 17:28:21 +0000 Subject: Switch to python 3 for Fedora 28+ --- diff --git a/pyhoca-gui-file.patch b/pyhoca-gui-file.patch new file mode 100644 index 0000000..52ed1cc --- /dev/null +++ b/pyhoca-gui-file.patch @@ -0,0 +1,12 @@ +diff -up pyhoca-gui-0.5.0.7/setup.py.file pyhoca-gui-0.5.0.7/setup.py +--- pyhoca-gui-0.5.0.7/setup.py.file 2017-09-24 03:02:41.000000000 -0600 ++++ pyhoca-gui-0.5.0.7/setup.py 2018-04-14 10:51:22.120132138 -0600 +@@ -33,7 +33,7 @@ PROGRAM_DESC_SHORT = '%s is a graphical + + # silence pyflakes with assigning a dummy version here... the real __VERSION__ assignment happens below + __VERSION__ = '0.0.0.0' +-for line in file(os.path.join('pyhoca', 'wxgui', '__init__.py')).readlines(): ++for line in open(os.path.join('pyhoca', 'wxgui', '__init__.py'),'r').readlines(): + if (line.startswith('__VERSION__')): + exec(line.strip()) + if platform.system() == 'Windows': diff --git a/pyhoca-gui-mro.patch b/pyhoca-gui-mro.patch new file mode 100644 index 0000000..5e79acd --- /dev/null +++ b/pyhoca-gui-mro.patch @@ -0,0 +1,12 @@ +diff -up pyhoca-gui-0.5.0.7/setup.py.mro pyhoca-gui-0.5.0.7/setup.py +--- pyhoca-gui-0.5.0.7/setup.py.mro 2018-04-14 10:52:19.582773079 -0600 ++++ pyhoca-gui-0.5.0.7/setup.py 2018-04-14 11:05:40.829314467 -0600 +@@ -209,7 +209,7 @@ class build_installer_py2exe(build_insta + # First, let py2exe do it's work. + py2exe.run(self) + +-class build_installer_bbfreeze(build_installer, Freezer, Command): ++class build_installer_bbfreeze(build_installer, Command, Freezer): + + user_options = [ + ('dist-dir=', 'd', diff --git a/pyhoca-gui.spec b/pyhoca-gui.spec index 668d399..57189fd 100644 --- a/pyhoca-gui.spec +++ b/pyhoca-gui.spec @@ -1,20 +1,37 @@ Name: pyhoca-gui Version: 0.5.0.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Graphical X2Go client written in (wx)Python Group: Applications/Communications License: AGPLv3+ URL: http://www.x2go.org/ Source0: http://code.x2go.org/releases/source/%{name}/%{name}-%{version}.tar.gz +Patch0: pyhoca-gui-file.patch +Patch1: pyhoca-gui-mro.patch BuildArch: noarch +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +BuildRequires: /usr/bin/2to3 +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-distutils-extra +%else BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-distutils-extra +%endif BuildRequires: desktop-file-utils BuildRequires: gettext BuildRequires: intltool +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +Requires: python%{python3_pkgversion}-cups +Requires: python%{python3_pkgversion}-setproctitle +Requires: python%{python3_pkgversion}-x2go >= 0.5.0.0 +Requires: libnotify +Requires: python%{python3_pkgversion}-gobject-base +Requires: python%{python3_pkgversion}-wxpython +%else %if 0%{?rhel} && 0%{?rhel} < 7 Requires: system-config-printer-libs Requires: python-argparse @@ -30,6 +47,7 @@ Requires: python2-gobject-base Requires: notify-python %endif Requires: python2-wxpython +%endif %description X2Go is a server based computing environment with: @@ -46,16 +64,26 @@ notification area and allows multiple X2Go session handling. %prep -%setup -q +%autosetup -p1 %build -%{__python} setup.py build_i18n -%{__python} setup.py build +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +2to3 --write --nobackups . +%{__python3} setup.py build_i18n +%py3_build +%else +%{__python2} setup.py build_i18n +%py2_build +%endif %install -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +%py3_install +%else +%py2_install +%endif mkdir -p %{buildroot}%{_bindir}/ cp -p %{name} %{buildroot}%{_bindir}/ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop @@ -79,7 +107,11 @@ fi %license COPYING %doc README TODO %{_bindir}/%{name} -%{python_sitelib}/* +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +%{python3_sitelib}/* +%else +%{python2_sitelib}/* +%endif %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/PyHoca/ %{_datadir}/pixmaps/pyhoca_x2go-logo-ubuntu.svg @@ -88,6 +120,9 @@ fi %changelog +* Sat Apr 14 2018 Orion Poplawski - 0.5.0.7-2 +- Switch to python 3 for Fedora 28+ + * Sat Apr 14 2018 Orion Poplawski - 0.5.0.7-1 - Update to 0.5.0.7