diff --git a/mod_wsgi-4.9.4.tar.gz b/mod_wsgi-4.9.4.tar.gz deleted file mode 100644 index c401c7a844e92aebb053638721a25f4a75861f96..0000000000000000000000000000000000000000 Binary files a/mod_wsgi-4.9.4.tar.gz and /dev/null differ diff --git a/mod_wsgi-5.0.0-ldflags.patch b/mod_wsgi-5.0.0-ldflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..92e091c89900c5f7b6a27d2aea52995b3cd7e619 --- /dev/null +++ b/mod_wsgi-5.0.0-ldflags.patch @@ -0,0 +1,88 @@ +From dbbbd249c5726767793fa0146a61941abba766f1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Mon, 15 Jan 2024 12:50:02 +0100 +Subject: [PATCH 1/2] Stop adding PYTHON_CFGDIR to LD_RUN_PATH and + PYTHON_LDFLAGS if there is no libpython + +The PYTHON_CFGDIR variable is more or less something like /usr/lib64/python3.12/config. + +Not only does this directory not exist on Python 3.6+ (it is called differently), +but there is no libpython.so in it. +Adding it to LD paths makes no difference. + +I could fix up the way the path is determined, +but I decided not to touch this code not to break old use cases. + +Instead, the directory is only added to LD paths when there is something relevant in it. + +Fixes https://github.com/GrahamDumpleton/mod_wsgi/issues/872 +--- + setup.py | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/setup.py b/setup.py +index edbe7c8f..c51bee70 100644 +--- a/setup.py ++++ b/setup.py +@@ -300,19 +300,21 @@ def get_apu_includes(): + if not os.path.exists(PYTHON_CFGDIR): + PYTHON_CFGDIR = '%s-%s' % (PYTHON_CFGDIR, sys.platform) + +- PYTHON_LDFLAGS = ['-L%s' % PYTHON_CFGDIR] ++ PYTHON_LDFLAGS = [] + if PYTHON_LIBDIR != APXS_LIBDIR: +- PYTHON_LDFLAGS.insert(0, '-L%s' % PYTHON_LIBDIR) ++ PYTHON_LDFLAGS.append('-L%s' % PYTHON_LIBDIR) + + PYTHON_LDLIBS = ['-lpython%s' % PYTHON_LDVERSION] + + if os.path.exists(os.path.join(PYTHON_LIBDIR, + 'libpython%s.a' % PYTHON_VERSION)): + PYTHON_LDLIBS = ['-lpython%s' % PYTHON_VERSION] ++ PYTHON_LDFLAGS.append('-L%s' % PYTHON_CFGDIR) + + if os.path.exists(os.path.join(PYTHON_CFGDIR, + 'libpython%s.a' % PYTHON_VERSION)): + PYTHON_LDLIBS = ['-lpython%s' % PYTHON_VERSION] ++ PYTHON_LDFLAGS.append('-L%s' % PYTHON_CFGDIR) + + # Create the final set of compilation flags to be used. + +@@ -326,7 +328,9 @@ def get_apu_includes(): + LD_RUN_PATHS = [] + if os.name != 'nt': + LD_RUN_PATH = os.environ.get('LD_RUN_PATH', '') +- LD_RUN_PATHS = [PYTHON_CFGDIR] ++ LD_RUN_PATHS = [] ++ if '-L%s' % PYTHON_CFGDIR in PYTHON_LDFLAGS: ++ LD_RUN_PATHS.append(PYTHON_CFGDIR) + if PYTHON_LIBDIR != APXS_LIBDIR: + LD_RUN_PATHS.insert(0, PYTHON_LIBDIR) + LD_RUN_PATH += ':' + ':'.join(LD_RUN_PATHS) + +From 7532634a52cdad466766c3ea52a539fd5fa5822d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 16 Jul 2024 11:10:12 +0200 +Subject: [PATCH 2/2] Don't set $LD_RUN_PATH when empty + +That lead to this failure when building in Fedora: + + ERROR 0010: file '/usr/lib64/python3.12/site-packages/mod_wsgi/server/mod_wsgi-py312.cpython-312-x86_64-linux-gnu.so' contains an empty runpath in [] +--- + setup.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index c51bee70..670bccac 100644 +--- a/setup.py ++++ b/setup.py +@@ -336,7 +336,8 @@ def get_apu_includes(): + LD_RUN_PATH += ':' + ':'.join(LD_RUN_PATHS) + LD_RUN_PATH = LD_RUN_PATH.lstrip(':') + +- os.environ['LD_RUN_PATH'] = LD_RUN_PATH ++ if LD_RUN_PATH: ++ os.environ['LD_RUN_PATH'] = LD_RUN_PATH + + # On MacOS X, recent versions of Apple's Apache do not support compiling + # Apache modules with a target older than 10.8. This is because it diff --git a/mod_wsgi-5.0.0.tar.gz b/mod_wsgi-5.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b824365ff3d4e8fe19b63f8ecfdc1e1b7e8456d1 Binary files /dev/null and b/mod_wsgi-5.0.0.tar.gz differ diff --git a/mod_wsgi.spec b/mod_wsgi.spec index ad5497c0f62a7ba089086970c6f5e09dad5dd48a..607ba6be77962adb8c651eabc954bef24b792a65 100644 --- a/mod_wsgi.spec +++ b/mod_wsgi.spec @@ -1,10 +1,10 @@ -%define anolis_release 3 +%define anolis_release 1 %{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$} %{?filter_setup} Name: mod_wsgi -Version: 4.9.4 +Version: 5.0.0 Release: %{anolis_release}%{?dist} Summary: A WSGI interface for Python web applications in Apache License: ASL 2.0 @@ -12,6 +12,10 @@ URL: https://modwsgi.readthedocs.io/ Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}/mod_wsgi-%{version}.tar.gz Source1: wsgi.conf Source2: wsgi-python3.conf + +# https://github.com/GrahamDumpleton/mod_wsgi/commit/dbbbd249c5726767793fa0146a61941abba766f1 +# https://github.com/GrahamDumpleton/mod_wsgi/commit/7532634a52cdad466766c3ea52a539fd5fa5822d +Patch0: mod_wsgi-5.0.0-ldflags.patch Patch1: mod_wsgi-4.5.20-exports.patch BuildRequires: httpd-devel gcc make @@ -80,6 +84,12 @@ mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-3} %doc CREDITS.rst README.rst %changelog +* Mon Mar 17 2025 Hong Wei Qin - 5.0.0-1 +- Update to 5.0.0 from 4.9.4 +- Add patches to fix LD_RUN_PATH handling + [Patches cherry-picked from c10s. Original changelog: + - Fix precedence of casts. (5.0.0-3)] + * Tue Mar 12 2024 Bo Ren - 4.9.4-3 - Rebuild with python3.11