diff --git a/python-nose.spec b/python-nose.spec index ebdc480..a98860e 100644 --- a/python-nose.spec +++ b/python-nose.spec @@ -6,7 +6,11 @@ %{!?python3_version: %global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")} %if 0%{?fedora} -%global with_python3 1 +%bcond_without python3 +%bcond_without platform_python +%else +%bcond_with python3 +%bcond_with platform_python %endif %global upstream_name nose @@ -33,7 +37,7 @@ output capture and more.\ Name: python-nose Version: 1.3.7 -Release: 14%{?dist} +Release: 15%{?dist} BuildArch: noarch License: LGPLv2+ and Public Domain @@ -58,11 +62,16 @@ Patch3: python-nose-readunicode.patch Patch4: python-nose-py36.patch BuildRequires: python2-devel -%if 0%{?with_python3} +%if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-coverage >= 3.4-1 %endif +%if %{with platform_python} +BuildRequires: platform-python-devel +BuildRequires: platform-python-setuptools +BuildRequires: platform-python-coverage >= 3.4-1 +%endif BuildRequires: python-setuptools BuildRequires: dos2unix BuildRequires: python-coverage >= 3.4-1 @@ -96,7 +105,7 @@ Requires: python-setuptools %{desc} -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{upstream_name} Summary: Discovery-based unit test extension for Python3 Group: Development/Languages @@ -111,6 +120,20 @@ This package installs the nose module and nosetests3 program that can discover python3 unit tests. %endif # with_python3 + +%if %{with platform_python} +%package -n platform-python-%{upstream_name} +Summary: Discovery-based unit test extension for Platform Python +Group: Development/Languages + + +%description -n platform-python-%{upstream_name} +%{desc} + +This package installs the nose module that can discover +platform-python unit tests. +%endif # with_platform_python + %prep %setup -q -n %{upstream_name}-%{version} %patch0 -p1 -b .coverage4 @@ -121,25 +144,43 @@ python3 unit tests. dos2unix examples/attrib_plugin.py -%if 0%{?with_python3} +%if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif # with_python3 +%if %{with platform_python} +rm -rf %{platform_py_dir} +cp -a . %{platform_py_dir} +%endif # with_python3 + %build %py2_build -%if 0%{?with_python3} +%if %{with python3} pushd %{py3dir} %py3_build popd %endif # with_python3 +%if %{with platform_python} +pushd %{platform_py_dir} +%platform_py_build +popd +%endif # with_platform_python + %install # Must do the python3 install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). -%if 0%{?with_python3} +%if %{with platform_python} +pushd %{platform_py_dir} +%platform_py_install +rm %{buildroot}%{_bindir}/* +popd +%endif # with_python3 + +%if %{with python3} pushd %{py3dir} %py3_install rm %{buildroot}%{_bindir}/nosetests @@ -175,7 +216,7 @@ rm -rf reST/.static reST/.templates %check %{__python2} selftest.py -%if 0%{?with_python3} +%if %{with python3} pushd %{py3dir} export PYTHONPATH=`pwd`/build/lib %{__python3} setup.py build_tests @@ -183,6 +224,14 @@ export PYTHONPATH=`pwd`/build/lib popd %endif # with_python3 +%if %{with platform_python} +pushd %{platform_py_dir} +export PYTHONPATH=`pwd`/build/lib +%{__platform_python} setup.py build_tests +%{__platform_python} selftest.py +popd +%endif # with_python3 + %files -n python2-%{upstream_name} %license lgpl.txt @@ -194,7 +243,7 @@ popd %{_mandir}/man1/nosetests-%{python_version}.1.gz %{python_sitelib}/nose* -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{upstream_name} %license lgpl.txt %{_bindir}/nosetests-3 @@ -204,6 +253,12 @@ popd %{python3_sitelib}/nose* %endif +%if %{with platform_python} +%files -n platform-python-%{upstream_name} +%license lgpl.txt +%{platform_python_sitelib}/nose* +%endif + %files docs %license lgpl.txt %doc AUTHORS CHANGELOG examples NEWS README.txt reST @@ -212,6 +267,9 @@ popd %endif # with_docs %changelog +* Thu Aug 10 2017 Miro HronĨok - 1.3.7-15 +- Add platform-python subpackage + * Thu Jul 27 2017 Fedora Release Engineering - 1.3.7-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild