[X2Go-Commits] [pyhoca-gui] 02/08: pyhoca-gui.spec: copy Python 2/3 helpers from PyHoca CLI.

git-admin at x2go.org git-admin at x2go.org
Sat Dec 21 04:22:03 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository pyhoca-gui.

commit 3d9bd7a65c83278be400c79bb7b5fc07ae8b5581
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Dec 19 03:12:29 2019 +0100

    pyhoca-gui.spec: copy Python 2/3 helpers from PyHoca CLI.
---
 debian/changelog |  5 +++
 pyhoca-gui.spec  | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 99 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6f94caf..9d825fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,11 @@ pyhoca-gui (0.6.1.0-0x2go1) UNRELEASED; urgency=medium
     + Fix typo in shebang-sed expression (for SUSE builds).
     + Fix same typo in shebang-sed expression (for RHEL builds).
 
+  [ Mihai Moldovan ]
+  * New upstream version (0.6.1.0):
+  * pyhoca-gui.spec:
+    + Copy Python 2/3 helpers from PyHoca CLI.
+
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 11 Dec 2019 12:47:21 +0100
 
 pyhoca-gui (0.5.1.0-0x2go1) unstable; urgency=medium
diff --git a/pyhoca-gui.spec b/pyhoca-gui.spec
index 135822a..aa7bb5a 100644
--- a/pyhoca-gui.spec
+++ b/pyhoca-gui.spec
@@ -1,3 +1,97 @@
+# Add conditional and ...
+%if 0%{?suse_version} > 1310 || 0%{?fedora} >= 26 || 0%{?rhel} >= 8
+# ... enable by default on newer distros.
+%bcond_without  python3
+%else
+# ... disable by default on older distros.
+%bcond_with     python3
+%endif
+
+# Fedora 30 deprecated Python 2, 31 disabled support for building these
+# packages.
+%if 0%{?fedora} >= 31
+%bcond_with    python2
+%else
+%bcond_without python2
+%endif
+
+# Prefer Python 3 if both variants have been requested.
+%if 0%{?with_python2} && 0%{?with_python3}
+%bcond_with python2
+%endif
+
+# Provide a default implementation, essentially for non-*SuSE platforms.
+%if 0%{?with_python3}
+%if ( ! ( 0%{?rhel} ) )
+%global name_helper_python3 python3
+%if 0%{?with_python2}
+%global name_helper_python2 python2
+%{?!python_module:%global python_module() python-%{**} python3-%{**}}
+%else
+%global name_helper_python2 %{nil}
+%{?!python_module:%global python_module() python3-%{**}}
+%endif
+%else
+%if 0%{?rhel} >= 7
+%global name_helper_python3 python%{python3_pkgversion}
+%if 0%{?with_python2}
+%global name_helper_python2 python2
+%{?!python_module:%global python_module() python-%{**} python%{python3_pkgversion}-%{**}}
+%else
+%global name_helper_python2 %{nil}
+%{?!python_module:%global python_module() python%{python3_pkgversion}-%{**}}
+%endif
+%else
+%global name_helper_python3 python34
+%if 0%{?with_python2}
+%global name_helper_python2 python
+%{?!python_module:%global python_module() python-%{**} python34-%{**}}
+%else
+%global name_helper_python2 %{nil}
+%{?!python_module:%global python_module() python34-%{**}}
+%endif
+%endif
+%endif
+%else
+%global name_helper_python3 %{nil}
+%if 0%{?with_python2}
+%global name_helper_python2 python
+%{?!python_module:%global python_module() python-%{**}}
+%else
+%global name_helper_python2 %{nil}
+%{?!python_module:%global python_module()}
+%endif
+%endif
+
+%if ! 0%{?with_python3}
+%global         skip_python3 1
+%endif
+
+%if ! 0%{?with_python2}
+%global         skip_python2 1
+%endif
+
+# Workaround for OpenSuSE Leap 42.3. This is the first version to introduce
+# the macros, but in a broken state. It will generate pythonX dependencies
+# if pythonX has been installed in the build environment and not honor
+# skip_pythonX.
+# Override to the expected behavior.
+%if 0%{?sle_version} && 0%{?sle_version} == 120300 && 0%{?is_opensuse}
+%if 0%{?with_python3}
+%if 0%{?with_python2}
+%global python_module() python-%{**} python3-%{**}
+%else
+%global python_module() python3-%{**}
+%endif
+%else
+%if 0%{?with_python2}
+%global python_module() python-%{**}
+%else
+%global python_module()
+%endif
+%endif
+%endif
+
 Name:           pyhoca-gui
 Version:        0.6.1.0
 Release:        0.0x2go1%{?dist}

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-gui.git


More information about the x2go-commits mailing list