Blame SPECS/python3.11-mod_wsgi.spec

652543
%global __python3 /usr/bin/python3.11
652543
%global python3_pkgversion 3.11
652543
652543
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
652543
652543
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
652543
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
652543
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
652543
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
652543
%{!?_httpd_moddir:    %{expand: %%global _httpd_moddir    %%{_libdir}/httpd/modules}}
652543
652543
%if 0%{?fedora} || 0%{?rhel} > 7
652543
%bcond_without python3
652543
%bcond_with python2
652543
%else
652543
%bcond_with python3
652543
%bcond_without python2
652543
%endif
652543
652543
Name:           python%{python3_pkgversion}-mod_wsgi
652543
Version:        4.9.4
652543
Release:        1%{?dist}
652543
Summary:        A WSGI interface for Python web applications in Apache
652543
License:        ASL 2.0
652543
URL:            https://modwsgi.readthedocs.io/
652543
Source0:        https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/mod_wsgi-%{version}.tar.gz
652543
Source1:        wsgi.conf
652543
Source2:        wsgi-python3.conf
652543
Patch1:         mod_wsgi-4.5.20-exports.patch
652543
Patch2:         mod_wsgi-4.7.1-remove-rpath.patch
652543
652543
BuildRequires:  httpd-devel
652543
BuildRequires:  gcc
652543
BuildRequires:  make
652543
652543
652543
Requires:       httpd-mmn = %{_httpd_mmn}
652543
BuildRequires:  python%{python3_pkgversion}-devel
652543
BuildRequires:  python%{python3_pkgversion}-rpm-macros
652543
BuildRequires:  python%{python3_pkgversion}-setuptools
652543
652543
# Suppress auto-provides for module DSO
652543
%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
652543
%{?filter_setup}
652543
652543
# httpd can only load one Python 3 version of mod_wsgi at the time, and
652543
# therefore we use a Conflicts tag to only allow one to be installed.  The
652543
# alternative would be to define a priority between them (e.g. python3- has
652543
# priority over python38-), however, it would be potentially confusing and
652543
# tricky to notice why the other version is not working.
652543
Conflicts: python3-mod_wsgi
652543
Conflicts: python38-mod_wsgi
652543
Conflicts: python39-mod_wsgi
652543
652543
%global _description\
652543
The mod_wsgi adapter is an Apache module that provides a WSGI compliant\
652543
interface for hosting Python based web applications within Apache. The\
652543
adapter is written completely in C code against the Apache C runtime and\
652543
for hosting WSGI applications within Apache has a lower overhead than using\
652543
existing WSGI adapters for mod_python or CGI.\
652543
652543
652543
%description %_description
652543
652543
%if %{with python2}
652543
%package -n python2-%{name}
652543
Summary: %summary
652543
Requires:       httpd-mmn = %{_httpd_mmn}
652543
BuildRequires:  python2-devel, python2-setuptools
652543
%{?python_provide:%python_provide python2-%{name}}
652543
%if 0%{?rhel} && 0%{?rhel} <= 7
652543
Provides: mod_wsgi = %{version}-%{release}
652543
Provides: mod_wsgi%{?_isa} = %{version}-%{release}
652543
Obsoletes: mod_wsgi < %{version}-%{release}
652543
%endif
652543
652543
%description -n python2-%{name} %_description
652543
652543
%endif
652543
652543
652543
652543
%prep
652543
%autosetup -p1 -n mod_wsgi-%{version}
652543
652543
: Python2=%{with python2} Python3=%{with python3}
652543
652543
%build
652543
652543
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
652543
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
652543
652543
%if %{with python3}
652543
mkdir py3build/
652543
# this always produces an error (because of trying to copy py3build
652543
# into itself) but we don't mind, so || :
652543
cp -R * py3build/ || :
652543
pushd py3build
652543
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=%{__python3}
652543
%make_build
652543
%py3_build
652543
popd
652543
%endif
652543
652543
%if %{with python2}
652543
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=%{python2}
652543
%make_build
652543
%py2_build
652543
%endif
652543
652543
%install
652543
# first install python3 variant and rename the so file
652543
%if %{with python3}
652543
pushd py3build
652543
%make_install LIBEXECDIR=%{_httpd_moddir}
652543
mv  $RPM_BUILD_ROOT%{_httpd_moddir}/mod_wsgi{,_python3}.so
652543
652543
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
652543
# httpd >= 2.4.x
652543
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi-python3.conf
652543
652543
%py3_install
652543
mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-3}
652543
ln -s %{_bindir}/mod_wsgi-express-3  $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express-%{python3_version}
652543
popd
652543
652543
%endif
652543
652543
# second install python2 variant
652543
%if %{with python2}
652543
%make_install LIBEXECDIR=%{_httpd_moddir}
652543
652543
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
652543
# httpd >= 2.4.x
652543
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi.conf
652543
652543
%py2_install
652543
mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-2}
652543
ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
652543
%endif
652543
652543
%if %{with python2}
652543
%files -n python2-%{name}
652543
%license LICENSE
652543
%doc CREDITS.rst README.rst
652543
%config(noreplace) %{_httpd_modconfdir}/*wsgi.conf
652543
%{_httpd_moddir}/mod_wsgi.so
652543
%{python2_sitearch}/mod_wsgi-*.egg-info
652543
%{python2_sitearch}/mod_wsgi
652543
%{_bindir}/mod_wsgi-express-2
652543
%{_bindir}/mod_wsgi-express
652543
%endif
652543
652543
%if %{with python3}
652543
%files -n python%{python3_pkgversion}-mod_wsgi
652543
%license LICENSE
652543
%doc CREDITS.rst README.rst
652543
%config(noreplace) %{_httpd_modconfdir}/*wsgi-python3.conf
652543
%{_httpd_moddir}/mod_wsgi_python3.so
652543
%{python3_sitearch}/mod_wsgi-*.egg-info
652543
%{python3_sitearch}/mod_wsgi
652543
%{_bindir}/mod_wsgi-express-%{python3_version}
652543
%{_bindir}/mod_wsgi-express-3
652543
%endif
652543
652543
%changelog
652543
* Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 4.9.4-1
652543
- Initial package
652543
- Fedora contributions by:
652543
      Adam Williamson <awilliam@redhat.com>
652543
      Alexander Bokovoy <abokovoy@redhat.com>
652543
      Bill Nottingham <notting@fedoraproject.org>
652543
      Dennis Gilmore <dennis@ausil.us>
652543
      dmalcolm <dmalcolm@fedoraproject.org>
652543
      Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
652543
      Igor Gnatenko <ignatenkobrain@fedoraproject.org>
652543
      Iryna Shcherbina <shcherbina.iryna@gmail.com>
652543
      Jakub Dorňák <jakub.dornak@misli.cz>
652543
      James Bowes <jbowes@repl.ca>
652543
      Jan Kaluza <jkaluza@redhat.com>
652543
      jbowes <jbowes@fedoraproject.org>
652543
      Jesse Keating <jkeating@fedoraproject.org>
652543
      Joe Orton <jorton@redhat.com>
652543
      joshkayse <joshkayse@fedoraproject.org>
652543
      Kevin Fenzi <kevin@fedoraproject.org>
652543
      Luboš Uhliarik <luhliari@redhat.com>
652543
      Luke Macken <lmacken@fedoraproject.org>
652543
      Matthias Runge <mrunge@redhat.com>
652543
      Miro Hrončok <miro@hroncok.cz>
652543
      Orion Poplawski <orion@cora.nwra.com>
652543
      Peter Robinson <pbrobinson@fedoraproject.org>
652543
      Richard W.M. Jones <rjones@redhat.com>
652543
      Ricky Zhou (周家杰) <ricky@fedoraproject.org>
652543
      Tomas Hrnciar <thrnciar@redhat.com>
652543
      Tom Stellard <tstellar@redhat.com>
652543
      Troy Dawson <tdawson@redhat.com>
652543
      Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>