python3.14-mod_wsgi/python3.14-mod_wsgi.spec
2025-11-28 11:26:23 +01:00

125 lines
4.3 KiB
RPMSpec

%global python3_pkgversion 3.14
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
Name: python%{python3_pkgversion}-mod_wsgi
Version: 5.0.2
Release: 5%{?dist}
Summary: A WSGI interface for Python web applications in Apache
License: Apache-2.0 AND CC-BY-3.0
URL: https://modwsgi.readthedocs.io/
Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/mod_wsgi-%{version}.tar.gz
Source1: wsgi.conf
Source2: wsgi-python3.conf
Patch1: mod_wsgi-4.5.20-exports.patch
BuildRequires: httpd-devel
BuildRequires: gcc
BuildRequires: make
Requires: httpd-mmn = %{_httpd_mmn}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
# Suppress auto-provides for module DSO
%global __provides_exclude_from %{_httpd_moddir}/.*\\.so$
# httpd can only load one Python 3 version of mod_wsgi at the time, and
# therefore we use a Conflicts tag to only allow one to be installed. The
# alternative would be to define a priority between them (e.g. python3- has
# priority over python3.12-), however, it would be potentially confusing and
# tricky to notice why the other version is not working.
Conflicts: python3-mod_wsgi
Conflicts: python3.11-mod_wsgi
Conflicts: python3.12-mod_wsgi
%global _description\
The mod_wsgi adapter is an Apache 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.\
%description %_description
%prep
%autosetup -p1 -n mod_wsgi-%{version}
%build
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
mkdir py3build/
# this always produces an error (because of trying to copy py3build
# into itself) but we don't mind, so || :
cp -R * py3build/ || :
pushd py3build
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=%{python3}
%make_build
%py3_build
popd
%install
# first install python3 variant and rename the so file
pushd py3build
%make_install LIBEXECDIR=%{_httpd_moddir}
mv $RPM_BUILD_ROOT%{_httpd_moddir}/mod_wsgi{,_python3}.so
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
# httpd >= 2.4.x
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi-python3.conf
%py3_install
mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-3}
ln -s %{_bindir}/mod_wsgi-express-3 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express-%{python3_version}
popd
%files -n python%{python3_pkgversion}-mod_wsgi
%license LICENSE
%doc CREDITS.rst README.rst
%config(noreplace) %{_httpd_modconfdir}/*wsgi-python3.conf
%{_httpd_moddir}/mod_wsgi_python3.so
%{python3_sitearch}/mod_wsgi-*.egg-info
%{python3_sitearch}/mod_wsgi
%{_bindir}/mod_wsgi-express-%{python3_version}
%{_bindir}/mod_wsgi-express-3
%changelog
* Fri Sep 19 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 5.0.2-5
- Initial package
Fedora contributions by:
Adam Williamson <awilliam@redhat.com>
Alexander Bokovoy <abokovoy@redhat.com>
Bill Nottingham <notting@fedoraproject.org>
Dan Callaghan <dcallagh@redhat.com>
David Malcolm <dmalcolm@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com>
Igor Gnatenko <ignatenko@redhat.com>
Iryna Shcherbina <ishcherb@redhat.com>
Jakub Dorňák <jdornak@redhat.com>
James Bowes <jbowes@redhat.com> 1.0-1
Jan Kaluza <jkaluza@redhat.com>
Jesse Keating <jkeating@fedoraproject.org>
Joe Orton <jorton@redhat.com>
Josh Kayse <joshkayse@fedoraproject.org>
Karolina Surma <ksurma@redhat.com>
Kevin Fenzi <kevin@fedoraproject.org>
Luboš Uhliarik <luhliari@redhat.com>
Luke Macken <lmacken@redhat.com>
Matthias Runge <mrunge@redhat.com>
Miro Hrončok <mhroncok@redhat.com>
Orion Poplawski <orion@cora.nwra.com>
Peter Robinson <pbrobinson@fedoraproject.org>
Richard W.M. Jones <rjones@redhat.com>
Ricky Zhou <ricky@fedoraproject.org>
Tomas Orsava <torsava@redhat.com>
Tomas Hrnciar <thrnciar@redhat.com>
Tom Stellard <tstellar@redhat.com>
Troy Dawson <tdawson@redhat.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>