From 046b3f783efbeaa456e9ead7d8fc41249268ff5a Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Jun 15 2023 17:50:45 +0000 Subject: Rework Ruby patches Disable python3-greenlet plugin for EPEL9 --- diff --git a/uwsgi.spec b/uwsgi.spec index 6aac1e8..0e7782a 100644 --- a/uwsgi.spec +++ b/uwsgi.spec @@ -10,6 +10,7 @@ %if 0%{?fedora} %bcond_without go %bcond_without python3 +%bcond_without python3_greenlet %bcond_without ruby19 %bcond_without tuntap %bcond_without zeromq @@ -52,6 +53,7 @@ %bcond_without python2 %bcond_without python3 %bcond_without python3_other +%bcond_without python3_greenlet %bcond_without gloox %bcond_without geoip # This only exists on EL7 @@ -83,6 +85,7 @@ %if 0%{?rhel} == 8 %bcond_without go %bcond_without python3 +%bcond_without python3_greenlet %bcond_without ruby19 %bcond_without tuntap %bcond_without zeromq @@ -121,6 +124,8 @@ %if 0%{?rhel} == 9 %bcond_without go %bcond_without python3 +# EPEL9 does not have python-greenlet-devel any more +%bcond_with python3_greenlet %bcond_without ruby19 %bcond_without tuntap # EPEL9 doesn't have zeromq yet @@ -186,7 +191,7 @@ Name: uwsgi Version: 2.0.21 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Fast, self-healing, application container server # uwsgi is licensed under GPLv2 with a linking exception # docs are licensed under MIT @@ -234,6 +239,8 @@ BuildRequires: python-greenlet-devel %endif %if %{with python3} BuildRequires: python%{python3_pkgversion}-devel +%endif +%if %{with python3_greenlet} BuildRequires: python%{python3_pkgversion}-greenlet-devel %endif %if %{with python3_other} @@ -743,7 +750,7 @@ This package contains the Python 2 greenlet plugin for uWSGI %endif %endif -%if %{with python3} +%if %{with python3_greenlet} %package -n uwsgi-plugin-python%{python3_pkgversion}-greenlet Summary: uWSGI - Plugin for Python %{python3_version} Greenlet support Requires: python%{python3_pkgversion}-greenlet, uwsgi-plugin-python%{python3_pkgversion} = %{version}-%{release} @@ -1308,7 +1315,7 @@ CFLAGS="%{optflags} -Wno-unused-but-set-variable" %{__python} uwsgiconfig.py --v %if %{with python2_greenlet} CFLAGS="%{optflags} -Wno-unused-but-set-variable" %{__python} uwsgiconfig.py --verbose --plugin plugins/greenlet fedora %endif -%if %{with python3} +%if %{with python3_greenlet} CFLAGS="%{optflags} -Wno-unused-but-set-variable" %{__python} uwsgiconfig.py --verbose --plugin plugins/greenlet fedora python%{python3_pkgversion}_greenlet %endif %if %{with glusterfs} @@ -1613,7 +1620,7 @@ exit 0 %{_libdir}/uwsgi/greenlet_plugin.so %endif -%if %{with python3} +%if %{with python3_greenlet} %files -n uwsgi-plugin-python%{python3_pkgversion}-greenlet %{_libdir}/uwsgi/python%{python3_pkgversion}_greenlet_plugin.so %endif @@ -1837,6 +1844,10 @@ exit 0 %changelog +* Thu Jun 15 2023 Ralf Ertzinger - 2.0.21-9 +- Rework Ruby patches +- Disable python3-greenlet plugin for EPEL9 + * Thu Jun 15 2023 Python Maint - 2.0.21-8 - Rebuilt for Python 3.12 diff --git a/uwsgi_fix_ruby_taint.patch b/uwsgi_fix_ruby_taint.patch index 720fb81..31f649a 100644 --- a/uwsgi_fix_ruby_taint.patch +++ b/uwsgi_fix_ruby_taint.patch @@ -1,6 +1,6 @@ diff -uNr a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c --- a/plugins/rack/rack_plugin.c 2022-10-24 12:21:58.000000000 +0200 -+++ b/plugins/rack/rack_plugin.c 2023-04-22 21:18:03.451028685 +0200 ++++ b/plugins/rack/rack_plugin.c 2023-06-13 21:47:46.514179214 +0200 @@ -456,7 +456,11 @@ static void rack_hack_dollar_zero(VALUE name, ID id) { @@ -14,26 +14,26 @@ diff -uNr a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c #ifndef RUBY19 diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py ---- a/plugins/rack/uwsgiplugin.py 2023-04-22 21:17:26.854810444 +0200 -+++ b/plugins/rack/uwsgiplugin.py 2023-04-22 21:18:03.454028704 +0200 -@@ -18,6 +18,8 @@ +--- a/plugins/rack/uwsgiplugin.py 2023-06-13 21:46:52.300833924 +0200 ++++ b/plugins/rack/uwsgiplugin.py 2023-06-13 21:48:54.740613764 +0200 +@@ -19,6 +19,8 @@ CFLAGS.append('-DRUBY19') - if version >= '2.0': - CFLAGS.append('-DRUBY20') -+ if version >= '2.7': -+ CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' ++ if v >= (2, 7): ++ CFLAGS.append('-DRUBY27') else: + CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['CFLAGS']\"" % rbconfig).read().rstrip().split() + diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py ---- a/plugins/ruby19/uwsgiplugin.py 2023-04-22 21:17:26.854810444 +0200 -+++ b/plugins/ruby19/uwsgiplugin.py 2023-04-22 21:18:36.479225658 +0200 -@@ -18,6 +18,8 @@ +--- a/plugins/ruby19/uwsgiplugin.py 2023-06-13 21:46:52.300833924 +0200 ++++ b/plugins/ruby19/uwsgiplugin.py 2023-06-13 21:49:24.566803721 +0200 +@@ -19,6 +19,8 @@ CFLAGS.append('-DRUBY19') - if version >= '2.0': - CFLAGS.append('-DRUBY20') -+ if version >= '2.7': -+ CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' ++ if v >= (2, 7): ++ CFLAGS.append('-DRUBY27') else: + CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['CFLAGS']\"" % rbconfig).read().rstrip().split() + diff --git a/uwsgi_ruby20_compatibility.patch b/uwsgi_ruby20_compatibility.patch index b4bf20d..6ac05dd 100644 --- a/uwsgi_ruby20_compatibility.patch +++ b/uwsgi_ruby20_compatibility.patch @@ -1,42 +1,34 @@ -diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py -index 2375bc9..b908417 100644 ---- a/plugins/rack/uwsgiplugin.py -+++ b/plugins/rack/uwsgiplugin.py -@@ -10,13 +10,14 @@ except: +diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py +--- a/plugins/rack/uwsgiplugin.py 2023-06-13 22:05:49.685878391 +0200 ++++ b/plugins/rack/uwsgiplugin.py 2023-06-13 22:07:22.640425653 +0200 +@@ -10,11 +10,11 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() -v = version.split('.') ++v = tuple(int(x) for x in version.split('.')) GCC_LIST = ['rack_plugin', 'rack_api'] -if (v[0] == '1' and v[1] == '9') or v[0] >= '2': -+if version >= '1.9': ++if v >= (1, 9): CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') -+ if version >= '2.0': -+ CFLAGS.append('-DRUBY20') CFLAGS.append('-Wno-unused-parameter') - rbconfig = 'RbConfig' - else: -diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py -index 4f35984..156018f 100644 ---- a/plugins/ruby19/uwsgiplugin.py -+++ b/plugins/ruby19/uwsgiplugin.py -@@ -10,13 +10,14 @@ except: +diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py +--- a/plugins/ruby19/uwsgiplugin.py 2023-06-13 22:05:49.685878391 +0200 ++++ b/plugins/ruby19/uwsgiplugin.py 2023-06-13 22:07:13.470371664 +0200 +@@ -10,11 +10,11 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() -v = version.split('.') ++v = tuple(int(x) for x in version.split('.')) GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api'] -if v[0] == '1' and v[1] == '9': -+if version >= '1.9': ++if v >= (1, 9): CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') -+ if version >= '2.0': -+ CFLAGS.append('-DRUBY20') CFLAGS.append('-Wno-unused-parameter') - rbconfig = 'RbConfig' - else: