# # spec file for package apache2-mod_wsgi # # Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define modname mod_wsgi %if 0%{?suse_version} BuildRequires: apache-rpm-macros BuildRequires: apache2-devel %else %define apache_apxs %{bindir}/apxs %define apache_sysconfdir %(%{apache_apxs} -q PREFIX) BuildRequires: httpd BuildRequires: httpd-devel %endif Name: apache2-mod_wsgi Version: 4.7.1 Release: 2.7.18 Summary: A WSGI interface for Python3 web applications in Apache License: Apache-2.0 Group: Productivity/Networking/Web/Servers URL: https://github.com/GrahamDumpleton/mod_wsgi Source: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/%{modname}-%{version}.tar.gz ## Work around for inconsistent Apache source tree in SLE 12, see bnc#915479 Patch0: wsgi_fixVersionCheck.patch BuildRequires: apache-rex %apache_rex_deps BuildRequires: python2-devel %if 0%{?suse_version} >= 1500 || 0%{?fedora} || 0%{?rhel} BuildRequires: python2-setuptools %endif Obsoletes: apache2-mod_wsgi-python3 < %{version}-%{release} Provides: %{modname} = %{version}-%{release} Provides: apache2-mod_wsgi-python3 = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} Requires: %{apache_mmn} Requires: %{apache_suse_maintenance_mmn} Requires: apache2 %else Requires: httpd %endif %description The mod_wsgi adapter is an Apacheache module that provides a WSGI compliant interface for hosting Python based web applications within Apache. The adapter is written completely in C code against the Apache C runtime and for hosting WSGI applications within Apache has a lower overhead than using existing WSGI adapters for mod_python or CGI. %prep %setup -q -n %{modname}-%{version} %patch0 -p1 %build export CFLAGS="%{optflags} -fno-strict-aliasing" %configure \ --with-apxs="%{apache_apxs}" \ --with-python="python2.7" # warning: "_XOPEN_SOURCE" redefined # "To get rid of the _POSIX_C_SOURCE warning, make sure to include Python.h first." # change for the correct include path sed -i 's|||' src/server/wsgi_python.h make %{?_smp_mflags} %if 0%{?suse_version} >= 1500 || 0%{?fedora} || 0%{?rhel} %python2_build %endif %install make install DESTDIR=%{buildroot} LIBEXECDIR=%{apache_libexecdir} %if 0%{?suse_version} >= 1500 || 0%{?fedora} || 0%{?rhel} %python2_install %endif mv %{buildroot}%{_bindir}/mod_wsgi-express %{buildroot}%{_bindir}/mod_wsgi-express-2.7 %check %apache_rex_check -m ./src/server/.libs mod_wsgi-basic %post %if 0%{?suse_version} if ! %{_sbindir}/a2enmod -q wsgi; then %{_sbindir}/a2enmod wsgi fi %endif %postun %if 0%{?suse_version} if [ "$1" = "0" ]; then if a2enmod -q wsgi; then %{_sbindir}/a2enmod -d wsgi fi fi %endif %files %defattr(-,root,root) %doc LICENSE README.rst docs/release-notes %dir %{apache_libexecdir} %{apache_libexecdir}/%{modname}.so %if 0%{?suse_version} >= 1500 || 0%{?fedora} || 0%{?rhel} %{python2_sitearch}/mod_wsgi-*.egg-info %{python2_sitearch}/mod_wsgi %{_bindir}/mod_wsgi-express-2.7 %endif %changelog * Fri Oct 1 2021 Matej Cepl - Add missing bug reference to allow inclusion in SLE-15:SP4. * Wed Nov 25 2020 pgajdos@suse.com - use /usr/sbin/apxs for build, not -prefork * Wed May 6 2020 Dominique Leuenberger - Update to version 4.7.1: + Use Python 3 style print. + Mostly changes around distribtion from PyPi, where mod_wsgi is completented by a mod_wsgi-standalone with an own apache instance. - Drop the python2 based package (py2 is EOL): Move the content of the former apache2-mod_wsgi-python3 package into apache-mod_wsgi. Provide/Obsolete the old -python3 package for ease of upgrade. * Thu Apr 9 2020 Neal Gompa - Add Python-native build so Python metadata and wrapper is present (bsc#1189467). * Mon Feb 10 2020 Petr Gajdos - add %%apache_rex_deps * Wed Dec 4 2019 pgajdos@suse.com - version update to 4.6.8 * If no system mime types file can be found, fall back to ``/dev/null`` so that Apache can still at least start up. * Fix compilation failures when using Python 3.8. * The Apache request ID is accessible in request events as ``request_id``. * The per request data dictionary accessible using ``mod_wsgi.request_data()`` is now also accessible in events as ``request_data``. * When the queue timeout was triggered for requests sent to daemon mode processes, the error response wasn't being flushed out correctly resulting in the connection still being held up to the time of the socket timeout. * Tue Dec 3 2019 pgajdos@suse.com - test with %%apache_rex_check * Sat Mar 23 2019 Dirk Mueller - update to 4.6.5: * When running mod_wsgi-express and serving up static files from the document root, and the WSGI application was mounted at a sub URL using --mount-point, the static files in the document root outside of the mount point for the WSGI application would no longer be accessible. * If no system mime types file can be found, fall back to /dev/null so that Apache can still at least start up. * Now possible to use mod_wsgi-express in an a zipapp created using shiv. This entailed a special workaround to detect when shiv was used, so that the unpacked site-packages directory could be added to the Python module search path for mod_wsgi-express. * Fri Apr 6 2018 dmueller@suse.com - update to 4.6.4: * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.19.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.20.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.21.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.22.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.23.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.24.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.6.0.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.6.1.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.6.2.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.6.3.html * see http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.6.4.html * Mon Mar 19 2018 tbechtold@suse.com - Fix description (bsc#1084882) * Sat Sep 16 2017 bruno@ioda-net.ch - update to 4.5.18 see full changes bugfix and new features here: http://modwsgi.readthedocs.io/en/latest/release-notes - specleanup * Fri Jun 3 2016 mrueckert@suse.de - update to 4.5.2 * Upstream release notes: + http://modwsgi.readthedocs.io/en/latest/release-notes/version-4.5.2.html + http://modwsgi.readthedocs.io/en/latest/release-notes/version-4.5.1.html + http://modwsgi.readthedocs.io/en/latest/release-notes/version-4.5.0.html + http://modwsgi.readthedocs.io/en/latest/release-notes/version-4.4.23.html - minimized delta between spec files - use the #/ trick for the source url * Sat Feb 20 2016 bruno@ioda-net.ch - update to 4.4.22 * Upstream release notes: + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.22.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.21.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.20.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.19.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.18.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.17.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.16.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.15.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.14.html * Mon Sep 28 2015 mc@suse.de - update to 4.4.13 * Upstream release notes: + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.13.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.12.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.11.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.10.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.9.html * Tue Sep 1 2015 pgajdos@suse.com - test module with %%apache_test_module_load * Sat Aug 15 2015 mc@suse.de - update to 4.4.8 * Upstream release notes: + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.7.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.8.html - seperate package for python3 to fix module loading errors - conflict with mod_wsgi-python3 * Thu Aug 6 2015 mc@suse.com - Build subpackage with mod_wsgi_python3 (bsc#939717) * Thu Jul 16 2015 pgajdos@suse.com - Requries: %%{apache_suse_maintenance_mmn} This will pull this module to the update (in released distribution) when apache maintainer thinks it is good (due api/abi changes). * Fri Jan 30 2015 rjschwei@suse.com - Fix build failure on SLE 12 (Apache 2.4.10) + add wsgi_fixVersionCheck.patch + build failed due to improper version check * Thu Jan 29 2015 rjschwei@suse.com - Update to version 4.4.6 - Upstream release notes: + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.6.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.5.html + http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.4.4.html ..... - As of version 4.2.7 mod_wsgi is effected by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758035 * Mon Nov 3 2014 pgajdos@suse.com - call spec-cleaner - use apache rpm macros * Thu Jul 10 2014 mc@suse.de - change URL to new location * Wed Jul 9 2014 mc@suse.de - provide short module name * Wed Jul 9 2014 mc@suse.de - Update to version 4.2.5 - remove mod_wsgi-3.4-connsbh.patch - included in upstream version - remove mod_wsgi-setuid-patch.diff - included in upstream version - No longer support the use of mod_python in conjunction with mod_wsgi - Adding a lot of new configuration option - fix off-by-one error in setgroups (bnc#883229) * Sat May 24 2014 mc@suse.com - fix Local privilege escalation (bnc#878550) CVE-2014-0240 * Mon Apr 28 2014 adaugherity@tamu.edu - Fix module name sent to a2enmod/a2dismod and fix/cleanup post/postun scripts. * Sat Nov 30 2013 agraf@suse.com - Add patch "mod_wsgi-3.4-connsbh.patch" to fix segmentation faults with apache 2.4 (https://bugzilla.redhat.com/show_bug.cgi?id=831701) * Wed Jan 30 2013 dimstar@opensuse.org - Update to version 3.4: + New support for Apache 2.4 + Support for Python 3.2 + Is now guaranteed that mod_ssl access handler is run before that for mod_wsgi so that any per request variables setup by mod_ssl are available in the mod_wsgi access handler as implemented by WSGIAccessScript directive. + Added 'python-home' option to WSGIDaemonProcess. + Added 'lang' and 'locale' options to WSGIDaemonProcess. + Split combined WWW-Authenticate header returned from daemon process back into separate headers. - Introduce build compatibility with apache 2.4: apxs2 was moved from %%{_sbindir} to %%{_bindir} * Fri Nov 16 2012 saschpe@suse.de - Require apache2, a module makes little sense without * Fri Dec 16 2011 chris@computersalat.de - add post/postun section * enable module after install (a2enmod) * disable module after deinstall (a2enmod -d) - fix License as required by http://spdx.org/licenses/ * Apache-2.0 - fix build for CentOS/RHEL - spec-cleanup * Sat Sep 17 2011 jengelh@medozas.de - Remove redundant tags/sections from specfile - Use %%_smp_mflags for parallel build * Wed Oct 27 2010 termim@gmail.com - update to 3.3: http://code.google.com/p/modwsgi/wiki/ChangesInVersion0303 * Wed May 13 2009 pascal.bleser@opensuse.org - update to 2.5: http://code.google.com/p/modwsgi/wiki/ChangesInVersion0205 - minor spec file fixes (use %%configure, -j%%jobs) * Wed Sep 17 2008 poeml@suse.de - update to 2.3. Changelog: http://code.google.com/p/modwsgi/wiki/ChangesInVersion0202 http://code.google.com/p/modwsgi/wiki/ChangesInVersion0203 * Fri Aug 8 2008 poeml@suse.de - update to 2.1. Changelog: http://code.google.com/p/modwsgi/wiki/ChangesInVersion0201 * Tue Mar 11 2008 poeml@suse.de - initial package (version 1.3)