Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22746: remove python2 support on rudder 8 #2736

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions rudder-api-client/SPECS/rudder-api-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
#=================================================
Expand Down
28 changes: 1 addition & 27 deletions rudder-relay/SPECS/rudder-relay.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down
29 changes: 0 additions & 29 deletions rudder-server/SPECS/rudder-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down