f63659
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
f63659
f63659
%if 0%{?fedora} || 0%{?rhel} > 7
f63659
%bcond_without python3
f63659
%else
f63659
%bcond_with python3
f63659
%endif
f63659
f63659
%if 0%{?fedora} || 0%{?rhel} <= 7
f63659
%bcond_without python2
f63659
%else
f63659
%bcond_with python2
f63659
%endif
f63659
f63659
%if %{with python3} && !%{with python2}
f63659
%global py3dir .
f63659
%endif
f63659
f63659
Name:           mod_wsgi
f63659
Version:        4.6.4
4a746b
Release:        4%{?dist}
f63659
Summary:        A WSGI interface for Python web applications in Apache
f63659
Group:          System Environment/Libraries
f63659
License:        ASL 2.0
f63659
URL:            https://modwsgi.readthedocs.io/
f63659
Source0:        https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/mod_wsgi-%{version}.tar.gz
f63659
Source1:        wsgi.conf
f63659
Source2:        wsgi-python3.conf
f63659
Patch1:         mod_wsgi-4.5.20-exports.patch
f63659
Patch2:         mod_wsgi-4.6.4-warnings.patch
f63659
BuildRequires:  httpd-devel
f63659
BuildRequires:  python3-sphinx
f63659
BuildRequires:  gcc
f63659
f63659
# Suppress auto-provides for module DSO
f63659
%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
f63659
%{?filter_setup}
f63659
f63659
f63659
f63659
%global _description\
f63659
The mod_wsgi adapter is an Apache module that provides a WSGI compliant\
f63659
interface for hosting Python based web applications within Apache. The\
f63659
adapter is written completely in C code against the Apache C runtime and\
f63659
for hosting WSGI applications within Apache has a lower overhead than using\
f63659
existing WSGI adapters for mod_python or CGI.\
f63659
f63659
f63659
%description %_description
f63659
f63659
%if %{with python2}
f63659
%package -n python2-%{name}
f63659
Summary: %summary
f63659
Requires:       httpd-mmn = %{_httpd_mmn}
f63659
BuildRequires:  python2-devel
f63659
%{?python_provide:%python_provide python2-%{name}}
f63659
# Remove before F30
f63659
Provides: mod_wsgi = %{version}-%{release}
f63659
Provides: mod_wsgi%{?_isa} = %{version}-%{release}
f63659
Obsoletes: mod_wsgi < %{version}-%{release}
f63659
f63659
%description -n python2-%{name} %_description
f63659
f63659
%endif
f63659
f63659
%if %{with python3}
f63659
%package -n python3-%{name}
f63659
Summary:        %summary
f63659
Requires:       httpd-mmn = %{_httpd_mmn}
f63659
BuildRequires:  python3-devel
f63659
f63659
%description -n python3-%{name} %_description
f63659
f63659
%endif
f63659
f63659
%prep
f63659
%setup -qn %{name}-%{version}
f63659
%patch1 -p1 -b .exports
f63659
%patch2 -p1 -b .warnings
f63659
f63659
%if "%{py3dir}" != "."
f63659
cp -a . %{py3dir}
f63659
%endif
f63659
f63659
%build
f63659
make -C docs html
f63659
f63659
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
f63659
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
f63659
f63659
%if %{with python2}
f63659
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=python2
f63659
make %{?_smp_mflags}
f63659
%py2_build
f63659
%endif
f63659
f63659
%if %{with python3}
f63659
pushd %{py3dir}
f63659
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=python3
f63659
make %{?_smp_mflags}
f63659
%py3_build
f63659
popd
f63659
%endif
f63659
f63659
%install
f63659
# first install python3 variant and rename the so file
f63659
%if %{with python3}
f63659
f63659
pushd %{py3dir}
f63659
make install DESTDIR=$RPM_BUILD_ROOT LIBEXECDIR=%{_httpd_moddir}
f63659
mv  $RPM_BUILD_ROOT%{_httpd_moddir}/mod_wsgi{,_python3}.so
f63659
f63659
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
f63659
# httpd >= 2.4.x
f63659
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi-python3.conf
f63659
f63659
%py3_install
f63659
mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-3}
f63659
popd
f63659
f63659
%endif
f63659
f63659
# second install python2 variant
f63659
%if %{with python2}
f63659
make install DESTDIR=$RPM_BUILD_ROOT LIBEXECDIR=%{_httpd_moddir}
f63659
f63659
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
f63659
# httpd >= 2.4.x
f63659
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi.conf
f63659
f63659
%py2_install
f63659
mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-2}
f63659
ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
f63659
%endif
f63659
f63659
%if %{with python2}
f63659
%files -n python2-%{name}
f63659
%license LICENSE
f63659
%doc CREDITS.rst README.rst
f63659
%config(noreplace) %{_httpd_modconfdir}/*wsgi.conf
f63659
%{_httpd_moddir}/mod_wsgi.so
f63659
%{python2_sitearch}/mod_wsgi-*.egg-info
f63659
%{python2_sitearch}/mod_wsgi
f63659
%{_bindir}/mod_wsgi-express-2
f63659
%{_bindir}/mod_wsgi-express
f63659
%endif
f63659
f63659
%if %{with python3}
f63659
%files -n python3-%{name}
f63659
%license LICENSE
f63659
%doc CREDITS.rst README.rst
f63659
%config(noreplace) %{_httpd_modconfdir}/*wsgi-python3.conf
f63659
%{_httpd_moddir}/mod_wsgi_python3.so
f63659
%{python3_sitearch}/mod_wsgi-*.egg-info
f63659
%{python3_sitearch}/mod_wsgi
f63659
%{_bindir}/mod_wsgi-express-3
f63659
%endif
f63659
f63659
%changelog
4a746b
* Wed Dec 04 2019 Lubos Uhliarik <luhliari@redhat.com> - 4.6.4-4
4a746b
- Resolves: #1779705 - python3-mod_wsgi: Remove the Provides and Obsoletes for
4a746b
  the name `mod_wsgi`
4a746b
f63659
* Thu Dec 13 2018 Joe Orton <jorton@redhat.com> - 4.6.4-3
f63659
- avoid unstripped binaries, re-enable debugsource generation (#1659086)
f63659
f63659
* Tue Dec 11 2018 Joe Orton <jorton@redhat.com> - 4.6.4-2
f63659
- fix covscan warnings (#1602620)
f63659
f63659
* Wed Jun 27 2018 Joe Orton <jorton@redhat.com> - 4.6.4-1
f63659
- update to 4.6.4 (#1592687)
f63659
f63659
* Tue Jun 26 2018 Tomas Orsava <torsava@redhat.com> - 4.6.2-5
f63659
- Switch to using Python 3 version of sphinx
f63659
f63659
* Tue Jun 26 2018 Tomas Orsava <torsava@redhat.com> - 4.6.2-4
f63659
- Update conditionals into bcond's so they can be manipulated during modular
f63659
  builds
f63659
f63659
* Tue Jun 26 2018 Tomas Orsava <torsava@redhat.com> - 4.6.2-3
f63659
- Fix the invocation of Python 2 to a versioned executable
f63659
f63659
* Thu Mar 22 2018 Troy Dawson <tdawson@redhat.com> - 4.6.2-2
f63659
- Update conditionals.
f63659
- Make preperations for non-python2 builds
f63659
f63659
* Tue Mar 13 2018 Matthias Runge <mrunge@redhat.com> - 4.6.2-1
f63659
- update to 4.6.2 (rhbz#1514768)
f63659
- add gcc BR
f63659
f63659
* Wed Feb  7 2018 Joe Orton <jorton@redhat.com> - 4.5.20-4
f63659
- restrict module DSO symbol exports
f63659
f63659
* Tue Jan 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.5.20-3
f63659
- Update Python 2 dependency declarations to new packaging standards
f63659
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
f63659
f63659
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.5.20-2
f63659
- Python 2 binary package renamed to python2-mod_wsgi
f63659
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
f63659
f63659
* Fri Oct 20 2017 Joe Orton <jorton@redhat.com> - 4.5.20-1
f63659
- update to 4.5.20
f63659
f63659
* Wed Aug 09 2017 Dan Callaghan <dcallagh@redhat.com> - 4.5.15-5
f63659
- include mod_wsgi Python package and mod_wsgi-express script
f63659
f63659
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.15-4
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
f63659
f63659
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.15-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f63659
f63659
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 4.5.15-2
f63659
- Rebuild due to bug in RPM (RHBZ #1468476)
f63659
f63659
* Fri Jun 23 2017 Joe Orton <jorton@redhat.com> - 4.5.15-1
f63659
- update to 4.5.15 (#1431893)
f63659
f63659
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.13-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f63659
f63659
* Tue Jan 10 2017 Jakub Dorňák <jakub.dornak@misli.cz> - 4.5.13-1
f63659
- Update to 4.5.13
f63659
f63659
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 4.5.9-2
f63659
- Rebuild for Python 3.6
f63659
f63659
* Mon Dec 05 2016 Matthias Runge <mrunge@redhat.com> - 4.5.9-1
f63659
- upgrade to 4.5.9 (rhbz#1180445)
f63659
f63659
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.8-4
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f63659
f63659
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.8-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
f63659
f63659
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.8-2
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f63659
f63659
* Thu Feb 12 2015 Richard W.M. Jones <rjones@redhat.com> - 4.4.8-1
f63659
- Upstream to 4.4.8.
f63659
- This version includes the fix for the segfault described in RHBZ#1178851.
f63659
f63659
* Mon Jan  5 2015 Jakub Dorňák <jdornak@redhat.com> - 4.4.3-1
f63659
- update to new upstream version 4.4.3 (#1176914)
f63659
f63659
* Wed Dec 17 2014 Jan Kaluza <jkaluza@redhat.com> - 4.4.1-1
f63659
- update to new upstream version 4.4.1 (#1170994)
f63659
f63659
* Wed Nov 19 2014 Jan Kaluza <jkaluza@redhat.com> - 4.3.2-1
f63659
- update to new upstream version 4.3.2 (#1104526)
f63659
f63659
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
f63659
f63659
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5-2
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f63659
f63659
* Thu May 29 2014 Luke Macken <lmacken@redhat.com> - 3.5-1
f63659
- Update to 3.5 to fix CVE-2014-0240 (#1101863)
f63659
- Remove all of the patches, which have been applied upstream
f63659
- Update source URL for new the GitHub upstream
f63659
f63659
* Wed May 28 2014 Joe Orton <jorton@redhat.com> - 3.4-14
f63659
- rebuild for Python 3.4
f63659
f63659
* Mon Apr 28 2014 Matthias Runge <mrunge@redhat.com> - 3.4.13
f63659
- do not use conflicts between mod_wsgi packages (rhbz#1087943)
f63659
f63659
* Thu Jan 23 2014 Joe Orton <jorton@redhat.com> - 3.4-12
f63659
- fix _httpd_mmn expansion in absence of httpd-devel
f63659
f63659
* Fri Jan 10 2014 Matthias Runge <mrunge@redhat.com> - 3.4-11
f63659
- added python3 subpackage (thanks to Jakub Dorňák), rhbz#1035876
f63659
f63659
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-10
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f63659
f63659
* Mon Jul  8 2013 Joe Orton <jorton@redhat.com> - 3.4-9
f63659
- modernize spec file (thanks to rcollet)
f63659
f63659
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-8
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f63659
f63659
* Tue Dec 11 2012 Jan Kaluza <jkaluza@redhat.com> - 3.4-7
f63659
- compile with -fno-strict-aliasing to workaround Python
f63659
  bug http://www.python.org/dev/peps/pep-3123/
f63659
f63659
* Thu Nov 22 2012 Joe Orton <jorton@redhat.com> - 3.4-6
f63659
- use _httpd_moddir macro
f63659
f63659
* Thu Nov 22 2012 Joe Orton <jorton@redhat.com> - 3.4-5
f63659
- spec file cleanups
f63659
f63659
* Wed Oct 17 2012 Joe Orton <jorton@redhat.com> - 3.4-4
f63659
- enable PR_SET_DUMPABLE in daemon process to enable core dumps
f63659
f63659
* Wed Oct 17 2012 Joe Orton <jorton@redhat.com> - 3.4-3
f63659
- use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)
f63659
- add logging for unexpected daemon process loss
f63659
f63659
* Wed Oct 17 2012 Matthias Runge <mrunge@redhat.com> - 3.4-2
f63659
- also use RPM_LD_FLAGS for build bz. #867137
f63659
f63659
* Mon Oct 15 2012 Matthias Runge <mrunge@redhat.com> - 3.4-1
f63659
- update to upstream release 3.4
f63659
f63659
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-7
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f63659
f63659
* Wed Jun 13 2012 Joe Orton <jorton@redhat.com> - 3.3-6
f63659
- add possible fix for daemon mode crash (#831701)
f63659
f63659
* Mon Mar 26 2012 Joe Orton <jorton@redhat.com> - 3.3-5
f63659
- move wsgi.conf to conf.modules.d
f63659
f63659
* Mon Mar 26 2012 Joe Orton <jorton@redhat.com> - 3.3-4
f63659
- rebuild for httpd 2.4
f63659
f63659
* Tue Mar 13 2012 Joe Orton <jorton@redhat.com> - 3.3-3
f63659
- prepare for httpd 2.4.x
f63659
f63659
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-2
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f63659
f63659
* Tue Nov 01 2011 James Bowes <jbowes@redhat.com> 3.3-1
f63659
- update to 3.3
f63659
f63659
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f63659
f63659
* Tue Jul 27 2010 David Malcolm <dmalcolm@redhat.com> - 3.2-2
f63659
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
f63659
f63659
* Tue Mar  9 2010 Josh Kayse <joshkayse@fedoraproject.org> - 3.2-1
f63659
- update to 3.2
f63659
f63659
* Sun Mar 07 2010 Josh Kayse <joshkayse@fedoraproject.org> - 3.1-2
f63659
- removed conflicts as it violates fedora packaging policy
f63659
f63659
* Sun Mar 07 2010 Josh Kayse <joshkayse@fedoraproject.org> - 3.1-1
f63659
- update to 3.1
f63659
- add explicit enable-shared
f63659
- add conflicts mod_python < 3.3.1
f63659
f63659
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-2
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f63659
f63659
* Thu Jul 02 2009 James Bowes <jbowes@redhat.com> 2.5-1
f63659
- Update to 2.5
f63659
f63659
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-3
f63659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f63659
f63659
* Sun Nov 30 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.3-2
f63659
- Rebuild for Python 2.6
f63659
f63659
* Tue Oct 28 2008 Luke Macken <lmacken@redhat.com> 2.3-1
f63659
- Update to 2.3
f63659
f63659
* Mon Sep 29 2008 James Bowes <jbowes@redhat.com> 2.1-2
f63659
- Remove requires on httpd-devel
f63659
f63659
* Wed Jul 02 2008 James Bowes <jbowes@redhat.com> 2.1-1
f63659
- Update to 2.1
f63659
f63659
* Mon Jun 16 2008 Ricky Zhou <ricky@fedoraproject.org> 1.3-4
f63659
- Build against the shared python lib.
f63659
f63659
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.3-3
f63659
- Autorebuild for GCC 4.3
f63659
f63659
* Sun Jan 06 2008 James Bowes <jbowes@redhat.com> 1.3-2
f63659
- Require httpd
f63659
f63659
* Sat Jan 05 2008 James Bowes <jbowes@redhat.com> 1.3-1
f63659
- Update to 1.3
f63659
f63659
* Sun Sep 30 2007 James Bowes <jbowes@redhat.com> 1.0-1
f63659
- Initial packaging for Fedora
f63659