adjust to use bconds (lbalhar, PR#6)

adjust to use make_install macro (tstellar, PR#8)
This commit is contained in:
Joe Orton 2021-06-18 10:47:19 +01:00
parent bc8ea91e75
commit 742a73db7a

View File

@ -12,21 +12,21 @@
%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_python3 1
%bcond_without python3
%else
%global with_python3 0
%bcond_with python3
%endif
%if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7)
%global with_python2 1
%bcond_without python2
%else
%global with_python2 0
%bcond_with python2
%global debug_package %{nil}
%endif
Name: mod_wsgi
Version: 4.8.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A WSGI interface for Python web applications in Apache
License: ASL 2.0
URL: https://modwsgi.readthedocs.io/
@ -54,7 +54,7 @@ existing WSGI adapters for mod_python or CGI.\
%description %_description
%if 0%{?with_python2} > 0
%if %{with python2}
%package -n python2-%{name}
Summary: %summary
Requires: httpd-mmn = %{_httpd_mmn}
@ -69,13 +69,13 @@ Obsoletes: mod_wsgi < %{version}-%{release}
%endif
%if 0%{?with_python3} > 0
%if %{with python3}
%package -n python3-%{name}
Summary: %summary
Requires: httpd-mmn = %{_httpd_mmn}
BuildRequires: python3-devel, python3-sphinx, python3-sphinx_rtd_theme
BuildRequires: python3-setuptools
%if 0%{?with_python2} == 0
%if !%{with python2}
Provides: mod_wsgi = %{version}-%{release}
Provides: mod_wsgi%{?_isa} = %{version}-%{release}
Obsoletes: mod_wsgi < %{version}-%{release}
@ -88,17 +88,17 @@ Obsoletes: mod_wsgi < %{version}-%{release}
%prep
%autosetup -p1 -n %{name}-%{version}
: Python2=%{with_python2} Python3=%{with_python3}
: Python2=%{with python2} Python3=%{with python3}
%build
%if %{with_python3}
%if %{with python3}
make -C docs html SPHINXBUILD=%{_bindir}/sphinx-build-3
%endif
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%if 0%{?with_python3} > 0
%if %{with python3}
mkdir py3build/
# this always produces an error (because of trying to copy py3build
# into itself) but we don't mind, so || :
@ -110,7 +110,7 @@ pushd py3build
popd
%endif
%if 0%{?with_python2} > 0
%if %{with python2}
%configure --enable-shared --with-apxs=%{_httpd_apxs} --with-python=python2
%{make_build}
%py2_build
@ -118,9 +118,9 @@ popd
%install
# first install python3 variant and rename the so file
%if 0%{?with_python3} > 0
%if %{with python3}
pushd py3build
make install DESTDIR=$RPM_BUILD_ROOT LIBEXECDIR=%{_httpd_moddir}
%make_install LIBEXECDIR=%{_httpd_moddir}
mv $RPM_BUILD_ROOT%{_httpd_moddir}/mod_wsgi{,_python3}.so
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
@ -134,8 +134,8 @@ popd
%endif
# second install python2 variant
%if 0%{?with_python2} > 0
make install DESTDIR=$RPM_BUILD_ROOT LIBEXECDIR=%{_httpd_moddir}
%if %{with python2}
%make_install LIBEXECDIR=%{_httpd_moddir}
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
# httpd >= 2.4.x
@ -146,7 +146,7 @@ mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-2}
ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
%endif
%if 0%{?with_python2} > 0
%if %{with python2}
%files -n python2-%{name}
%license LICENSE
%doc CREDITS.rst README.rst
@ -158,7 +158,7 @@ ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
%{_bindir}/mod_wsgi-express
%endif
%if 0%{?with_python3} > 0
%if %{with python3}
%files -n python3-%{name}
%license LICENSE
%doc CREDITS.rst README.rst
@ -170,6 +170,10 @@ ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
%endif
%changelog
* Fri Jun 18 2021 Joe Orton <jorton@redhat.com> - 4.8.0-2
- adjust to use bconds (lbalhar, PR#6)
- adjust to use make_install macro (tstellar, PR#8)
* Thu Jun 17 2021 Alexander Bokovoy <abokovoy@redhat.com> - 4.8.0-1
- update to 4.8.0
- Add experimental Python 3.10 support (#1898158)