From 236a0f17da0721828763c4a8f836cd1ea6a74e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Peccatte?= Date: Wed, 10 May 2023 15:23:30 +0200 Subject: [PATCH] Fixes #22746: remove python2 support on rudder 8 --- .../SPECS/rudder-api-client.spec | 21 +++----------- rudder-relay/SPECS/rudder-relay.spec | 28 +----------------- rudder-server/SPECS/rudder-server.spec | 29 ------------------- 3 files changed, 5 insertions(+), 73 deletions(-) diff --git a/rudder-api-client/SPECS/rudder-api-client.spec b/rudder-api-client/SPECS/rudder-api-client.spec index 9ba3e22f9..8dbed1cf4 100644 --- a/rudder-api-client/SPECS/rudder-api-client.spec +++ b/rudder-api-client/SPECS/rudder-api-client.spec @@ -47,20 +47,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) AutoReq: 0 AutoProv: 0 -## Python 2 -%if 0%{?rhel} == 7 || ( 0%{?suse_version} && 0%{?suse_version} < 1500 ) -BuildRequires: python, python-requests -Requires: python, python-requests, python-urllib3 -%else -## Python 3, rhel8 -%if 0%{?rhel} >= 8 +## Python 3 BuildRequires: python3, python3-requests Requires: python3, python3-requests, python3-urllib3 -%else -## sles 15 && fedora -BuildRequires: python3, python3-requests -Requires: python3, python3-requests, python3-docopt, python3-urllib3 -%endif + +%if 0%{?suse_version} || 0%{?fedora} +Requires: python3-docopt %endif %description @@ -80,11 +72,6 @@ cd rudder-sources-*/rudder-api-client/ make --debug install DESTDIR=%{buildroot} -# rhel7 does not have python3 so we force python2 instead -%if 0%{?rhel} == 7 || ( 0%{?suse_version} && 0%{?suse_version} < 1500 ) -find %{buildroot} -type f | xargs sed -i '1,1s|#!/usr/bin/python3|#!/usr/bin/python2|' -%endif - #================================================= # Cleaning #================================================= diff --git a/rudder-relay/SPECS/rudder-relay.spec b/rudder-relay/SPECS/rudder-relay.spec index b92cea428..03dc1fd14 100644 --- a/rudder-relay/SPECS/rudder-relay.spec +++ b/rudder-relay/SPECS/rudder-relay.spec @@ -88,12 +88,9 @@ Requires: mod_ssl shadow-utils python3-policycoreutils policycoreutils-python-ut BuildRequires: selinux-policy-devel %endif -%if 0%{?rhel} && 0%{?rhel} > 7 +%if 0%{?rhel} Requires: python3-policycoreutils policycoreutils-python-utils %endif -%if 0%{?rhel} && 0%{?rhel} <= 7 -Requires: policycoreutils-python -%endif %if 0%{?rhel} && 0%{?rhel} >= 9 Requires: libpq @@ -104,25 +101,9 @@ Requires: libpq Requires: pwdutils %endif -# Doc for suse versioning https://en.opensuse.org/openSUSE:Packaging_for_Leap -%if 0%{?suse_version} && 0%{?suse_version} < 1500 -BuildRequires: python -Requires: python, python-pyOpenSSL -%endif -%if 0%{?suse_version} && 0%{?suse_version} >= 1500 -BuildRequires: python3 -Requires: python3 -%endif - - ## Python -%if 0%{?rhel} == 7 || ( 0%{?suse_version} && 0%{?suse_version} < 1500 ) -BuildRequires: python, python-setuptools, python-lxml, python-requests -Requires: python, python-setuptools, python-lxml, python-requests -%else BuildRequires: python3, python3-pip, python3-lxml, python3-requests Requires: python3, python3-lxml, python3-requests, python3-setuptools -%endif %description Rudder is an open source configuration management and audit solution. @@ -147,14 +128,7 @@ cd rudder-sources-*/rudder/relay/sources/ sed -i "s|^DocumentRoot /var/www$|DocumentRoot /srv/www|" apache/rudder-apache-relay-common.conf %endif -%if 0%{?rhel} == 7 -# rhel7 doesn't have python 3 so we force python2 instead -# See #22404 to handle file with whitespace in name -find . -type f | xargs -d '\n' sed -i '1,1s|#!/usr/bin/python3|#!/usr/bin/python2|' -make --debug build SELINUX=%{selinux} PYTHON=python2 -%else make --debug build SELINUX=%{selinux} -%endif #================================================= # Installation diff --git a/rudder-server/SPECS/rudder-server.spec b/rudder-server/SPECS/rudder-server.spec index dd54aa62b..48e64951f 100644 --- a/rudder-server/SPECS/rudder-server.spec +++ b/rudder-server/SPECS/rudder-server.spec @@ -118,38 +118,9 @@ BuildRequires: libopenssl-devel Requires: jre-headless >= 17 %endif -## Openssl 1.1.1 required for openldap -# Here rhel7 = al2 as rhel7 is not supported in Rudder anymore -# We rely on the EPEL package for build. -%if 0%{?rhel} && 0%{?rhel} == 7 -BuildRequires: openssl11-devel -Requires: openssl11 -%endif - ## Python 3 -%if 0%{?rhel} && 0%{?rhel} == 7 -BuildRequires: python -Requires: python -%endif -%if 0%{?rhel} && 0%{?rhel} >= 8 BuildRequires: python3 Requires: python3 -%endif -# Doc for suse versioning https://en.opensuse.org/openSUSE:Packaging_for_Leap -%if 0%{?suse_version} && 0%{?suse_version} < 1500 -BuildRequires: python -Requires: python, python-pyOpenSSL -%endif -%if 0%{?suse_version} && 0%{?suse_version} >= 1500 -Requires: python3 -BuildRequires: python3 -Requires: python3 -%endif -%if 0%{?fedora} -BuildRequires: python3 -Requires: python3 -%endif - %description Rudder is an open source configuration management and audit solution.