From 7d555e5d12aa4135104cf0c96b1e1c7115a8ed96 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 27 Apr 2015 12:05:18 -0400 Subject: [PATCH] Conditionalize python3 subpackage (for epel7). --- python-waitress.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/python-waitress.spec b/python-waitress.spec index 2650629..eecb4f9 100644 --- a/python-waitress.spec +++ b/python-waitress.spec @@ -1,8 +1,12 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: python-waitress Version: 0.8.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Waitress WSGI server License: ZPLv2.1 @@ -27,6 +31,7 @@ It supports HTTP/1.0 and HTTP/1.1. For more information, see %{_pkgdocdir}/docs or http://docs.pylonsproject.org/projects/waitress/en/latest/ . +%if 0%{?with_python3} %package -n python3-waitress Summary: Waitress WSGI server Requires: python3 @@ -46,6 +51,7 @@ It supports HTTP/1.0 and HTTP/1.1. For more information, see %{_pkgdocdir}/docs or http://docs.pylonsproject.org/projects/waitress/en/latest/ . +%endif %prep %setup -q -n waitress-%{version} @@ -54,23 +60,29 @@ rm -f .gitignore docs/.gitignore # this script has devel paths, not useful in a user system rm -f docs/rebuild +%if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} +%endif %build %{__python2} setup.py build +%if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd +%endif %install # Run the Python 3 install first so that the Python 2 version # of /usr/bin/waitress-server "wins": +%if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT popd +%endif %{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT @@ -83,9 +95,11 @@ popd # in develop mode here. PYTHONPATH=. %{__python2} setup.py nosetests +%if 0%{?with_python3} pushd %{py3dir} PYTHONPATH=. %{__python3} setup.py nosetests popd +%endif %files @@ -94,13 +108,17 @@ popd %{python2_sitelib}/waitress %{python2_sitelib}/waitress-%{version}-py2.?.egg-info +%if 0%{?with_python3} %files -n python3-waitress %doc README.rst CHANGES.txt COPYRIGHT.txt LICENSE.txt docs %{python3_sitelib}/waitress %{python3_sitelib}/waitress-%{version}-py3.?.egg-info +%endif %changelog +* Mon Apr 27 2015 Ralph Bean - 0.8.9-5 +- Conditionalize the python3 subpackage. * Mon Jul 14 2014 Lorenzo Gil Sanchez - 0.8.9-4 - Fix comment in %description about versioned directory for docs