Update conditionals.
Make preperations for non-python2 builds
This commit is contained in:
parent
17ef2c3cb0
commit
2563c5f5e4
@ -6,15 +6,21 @@
|
||||
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
|
||||
%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
|
||||
|
||||
%if 0%{?fedora} > 12
|
||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||
%global with_python3 1
|
||||
%else
|
||||
%global with_python3 0
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} <= 7
|
||||
%global with_python2 1
|
||||
%else
|
||||
%global with_python2 0
|
||||
%endif
|
||||
|
||||
Name: mod_wsgi
|
||||
Version: 4.6.2
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: A WSGI interface for Python web applications in Apache
|
||||
Group: System Environment/Libraries
|
||||
License: ASL 2.0
|
||||
@ -25,7 +31,7 @@ Source2: wsgi-python3.conf
|
||||
Patch1: mod_wsgi-4.5.20-exports.patch
|
||||
|
||||
BuildRequires: httpd-devel
|
||||
BuildRequires: python2-sphinx
|
||||
BuildRequires: python-sphinx
|
||||
BuildRequires: gcc
|
||||
|
||||
# Suppress auto-provides for module DSO
|
||||
@ -44,6 +50,7 @@ existing WSGI adapters for mod_python or CGI.\
|
||||
|
||||
%description %_description
|
||||
|
||||
%if 0%{?with_python2} > 0
|
||||
%package -n python2-%{name}
|
||||
Summary: %summary
|
||||
Requires: httpd-mmn = %{_httpd_mmn}
|
||||
@ -56,6 +63,7 @@ Obsoletes: mod_wsgi < %{version}-%{release}
|
||||
|
||||
%description -n python2-%{name} %_description
|
||||
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python3} > 0
|
||||
%package -n python3-%{name}
|
||||
@ -80,9 +88,12 @@ make -C docs html
|
||||
|
||||
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
|
||||
|
||||
%if 0%{?with_python2} > 0
|
||||
%configure --enable-shared --with-apxs=%{_httpd_apxs}
|
||||
make %{?_smp_mflags}
|
||||
%py2_build
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python3} > 0
|
||||
pushd %{py3dir}
|
||||
@ -110,6 +121,8 @@ popd
|
||||
|
||||
%endif
|
||||
|
||||
# second install python2 variant
|
||||
%if 0%{?with_python2} > 0
|
||||
make install DESTDIR=$RPM_BUILD_ROOT LIBEXECDIR=%{_httpd_moddir}
|
||||
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir}
|
||||
@ -119,7 +132,9 @@ install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi.conf
|
||||
%py2_install
|
||||
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
|
||||
%files -n python2-%{name}
|
||||
%license LICENSE
|
||||
%doc CREDITS.rst README.rst
|
||||
@ -129,6 +144,7 @@ ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
|
||||
%{python2_sitearch}/mod_wsgi
|
||||
%{_bindir}/mod_wsgi-express-2
|
||||
%{_bindir}/mod_wsgi-express
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python3} > 0
|
||||
%files -n python3-%{name}
|
||||
@ -142,6 +158,10 @@ ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Mar 22 2018 Troy Dawson <tdawson@redhat.com> - 4.6.2-2
|
||||
- Update conditionals.
|
||||
- Make preperations for non-python2 builds
|
||||
|
||||
* Tue Mar 13 2018 Matthias Runge <mrunge@redhat.com> - 4.6.2-1
|
||||
- update to 4.6.2 (rhbz#1514768)
|
||||
- add gcc BR
|
||||
|
||||
Loading…
Reference in New Issue
Block a user