[X2Go-Commits] [python-x2go] 01/01: python-x2go.spec: disable python2 builds on FC31+.

git-admin at x2go.org git-admin at x2go.org
Tue Sep 3 02:24:16 CEST 2019


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

x2go pushed a commit to branch master
in repository python-x2go.

commit cb6ac407e7aba973c97fbf5790437009605f98b5
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Sep 3 02:23:47 2019 +0200

    python-x2go.spec: disable python2 builds on FC31+.
    
    Python 2 support has been deprecated in FC30 with a mass-removal of
    packages and FC31 continues this trend, but also disallows building new
    Python 2 packages.
---
 debian/changelog |  3 +++
 python-x2go.spec | 39 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index caefae9..2266a51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,6 +27,9 @@ python-x2go (0.6.1.0-0x2go1) UNRELEASED; urgency=medium
       %endif clause, so move the comment to a separate line. Technically,
       comments are only allowed at the start of a line, so that's not
       incorrect...
+    + Disable python2 builds on FC31+. Python 2 support has been deprecated in
+      FC30 with a mass-removal of packages and FC31 continues this trend, but
+      also disallows building new Python 2 packages.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Sat, 01 Dec 2018 02:16:45 +0100
 
diff --git a/python-x2go.spec b/python-x2go.spec
index 109877c..38c999c 100644
--- a/python-x2go.spec
+++ b/python-x2go.spec
@@ -7,17 +7,37 @@
 %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
+
 # Provide a default implementation, essentially for non-*SuSE platforms.
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )
+%if 0%{?with_python2}
 %{?!python_module:%global python_module() python-%{**} python3-%{**}}
 %else
+%{?!python_module:%global python_module() python3-%{**}}
+%endif
+%else
+%if 0%{?with_python2}
 %{?!python_module:%global python_module() python-%{**}}
+%else
+%{?!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
@@ -25,9 +45,17 @@
 # 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
 
@@ -47,11 +75,13 @@ Source0:        http://code.x2go.org/releases/source/%{name}/%{name}-%{version}.
 
 BuildArch:      noarch
 # OpenSuSE Leap or SLE and either OpenSuSE Leap 42.2 or lower               or        SLE
+%if 0%{?with_python2}
 %if 0%{?sle_version} && ( ( 0%{?sle_version} < 120300 && 0%{?is_opensuse} ) || ( ! 0%{?is_opensuse} ) )
 BuildRequires:  python-devel
 %else
 BuildRequires:  python2-devel
 %endif
+%endif
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )
 BuildRequires:  python3-devel
 %endif
@@ -96,7 +126,7 @@ X2Go is a server based computing environment with:
 This Python module allows you to integrate X2Go client support into your
 Python applications by providing a Python-based X2Go client API.
 
-
+%if 0%{?with_python2}
 # Let's assume that RHEL/EPEL 8 finally introduce proper Python 3 support...
 %if ( ! 0%{?rhel} ) || 0%{?rhel} >= 8
 %package -n python2-x2go
@@ -130,6 +160,7 @@ X2Go is a server based computing environment with:
 This Python module allows you to integrate X2Go client support into your
 Python applications by providing a Python-based X2Go client API.
 %endif
+%endif
 
 
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )
@@ -183,6 +214,7 @@ find x2go -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python||'
 
 
 %build
+%if 0%{?with_python2}
 %if 0%{?suse_version}
 %if 0%{?sle_version} && ( ( 0%{?sle_version} < 120300 && 0%{?is_opensuse} ) || ( ! 0%{?is_opensuse} ) )
 python2 setup.py build
@@ -192,6 +224,7 @@ python2 setup.py build
 %else
 %{py2_build}
 %endif
+%endif
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )
 %if 0%{?suse_version}
 %if 0%{?sle_version} && ( ( 0%{?sle_version} < 120300 && 0%{?is_opensuse} ) || ( ! 0%{?is_opensuse} ) )
@@ -210,6 +243,7 @@ make -f Makefile.docupload docbuild
 
 
 %install
+%if 0%{?with_python2}
 %if 0%{?suse_version}
 %if 0%{?sle_version} && ( ( 0%{?sle_version} < 120300 && 0%{?is_opensuse} ) || ( ! 0%{?is_opensuse} ) )
 python2 setup.py install --skip-build --root %{buildroot}
@@ -219,6 +253,7 @@ python2 setup.py install --skip-build --root %{buildroot}
 %else
 %{py2_install}
 %endif
+%endif
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )
 %if 0%{?suse_version}
 %if 0%{?sle_version} && ( ( 0%{?sle_version} < 120300 && 0%{?is_opensuse} ) || ( ! 0%{?is_opensuse} ) )
@@ -240,6 +275,7 @@ python3 setup.py install --skip-build --root %{buildroot}
 %defattr(-,root,root)
 %doc docs/build/html
 
+%if 0%{?with_python2}
 %if 0%{?rhel} && 0%{?rhel} < 8
 %files
 %else
@@ -261,6 +297,7 @@ python3 setup.py install --skip-build --root %{buildroot}
 %{python2_sitelib}/x2go/
 %{python2_sitelib}/x2go-*/
 %endif
+%endif
 
 
 %if 0%{?with_python3} && ( ! ( 0%{?rhel} ) || 0%{?rhel} > 7 )

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


More information about the x2go-commits mailing list