Skip to content

Commit f6be8cf

Browse files
authored
Merge pull request #93 from defanator/RHEL9
packages: add RHEL 9 support
2 parents 8d32f72 + dc7a439 commit f6be8cf

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

packages/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ get_os_name () {
8686
sed 's/.*(\(.*\)).*/\1/' | head -1 | \
8787
tr '[:upper:]' '[:lower:]'`
8888
# For CentOS grab release
89-
release=`cat /etc/*-release | grep -i 'almalinux\|rocky\|centos.*[0-9]' | \
90-
sed 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' | head -1`
89+
release=`cat /etc/*-release | grep -i '^version_id=' | cut -d '"' -f 2 | cut -c 1`
9190
;;
9291
rhel|ol)
9392
codename=`cat /etc/*-release | grep -i 'red hat.*(' | \
@@ -522,7 +521,7 @@ case "$os" in
522521
incr_step
523522

524523
case "$os$release" in
525-
rhel8|centos8|amzn2)
524+
rhel8|rhel9|centos8|centos9|amzn2)
526525
check_python 3
527526
python_supported=3
528527
;;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
gevent==21.8.0
2+
greenlet==1.1.3
3+
netaddr==0.8.0
4+
flup==1.0.3
5+
crossplane==0.5.7
6+
rstr==3.0.0
7+
python-daemon==2.2.4
8+
ujson==5.4.0
9+
PyMySQL==1.0.2

packages/nginx-amplify-agent/rpm/nginx-amplify-agent.spec

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,22 @@ BuildRequires: python3-pip
2323
%if 0%{?amzn} >= 2
2424
Requires: python3 >= 3.7
2525
Requires: python3-requests
26-
%else
26+
%endif
27+
28+
%if 0%{?rhel} == 8
2729
Requires: python3 >= 3.6
2830
Requires: python3-gevent
2931
Requires: python3-requests
3032
Requires: python3-netifaces
3133
%endif
3234

35+
%if 0%{?rhel} == 9
36+
Requires: python3 >= 3.9
37+
Requires: python3-requests
38+
Requires: python3-netifaces
39+
Requires: python3-psutil
40+
%endif
41+
3342
Requires: initscripts >= 8.36
3443
Requires(post): chkconfig
3544

@@ -50,12 +59,17 @@ See http://nginx.com/amplify for more information
5059

5160
%prep
5261
%setup -q -n nginx-amplify-agent-%{version}
53-
cp -p %{SOURCE0} .
62+
%{__cp} -p %{SOURCE0} .
5463

5564

5665
%build
5766
%{__python3} -m pip install --upgrade --target=amplify --no-compile -r %%REQUIREMENTS%%
58-
%{__python3} -c 'import setuptools; exec(open("setup.py").read())' build
67+
%if 0%{?rhel} == 9
68+
# https://github.com/pypa/pip/issues/10629
69+
%{__python3} -m pip install --upgrade --target=amplify_ --no-compile zope.event
70+
%{__cp} -Pr amplify_/zope* amplify/
71+
%endif
72+
%{__python3} setup.py build
5973

6074

6175
%pre

0 commit comments

Comments
 (0)