diff --git a/python-unittest2.spec b/python-unittest2.spec index b36eccc..07986a2 100644 --- a/python-unittest2.spec +++ b/python-unittest2.spec @@ -5,7 +5,7 @@ Name: python-%{pypi_name} Version: 1.1.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The new features in unittest backported to Python 2.4+ License: BSD @@ -21,6 +21,16 @@ Patch1: unittest2-1.1.0-remove-traceback2-from-requires.patch Patch2: unittest2-1.1.0-backport-tests-from-py3.5.patch BuildArch: noarch + +%description +unittest2 is a backport of the new features added to the unittest testing +framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, +3.2, 3.3, 3.4 and pypy. + + +%package -n python2-%{pypi_name} +Summary: The new features in unittest backported to Python 2.4+ +%{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-six @@ -31,36 +41,37 @@ Requires: python-traceback2 Requires: python-setuptools Requires: python-six -%if %{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-six -%if ! 0%{?bootstrap_traceback2} -BuildRequires: python3-traceback2 -%endif # bootstrap_traceback2 -%endif # if with_python3 - -%description +%description -n python2-%{pypi_name} unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, 3.2, 3.3, 3.4 and pypy. + %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: The new features in unittest backported to Python 2.4+ +%{?python_provide:%python_provide python3-%{pypi_name}} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-six +%if ! 0%{?bootstrap_traceback2} +BuildRequires: python3-traceback2 +%endif # bootstrap_traceback2 Requires: python3-setuptools Requires: python3-six %if ! 0%{?bootstrap_traceback2} Requires: python3-traceback2 %endif + %description -n python3-%{pypi_name} unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, 3.2, 3.3, 3.4 and pypy. %endif # with_python3 + %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info @@ -72,21 +83,13 @@ rm -rf %{pypi_name}.egg-info %patch1 -p0 %endif -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif # with_python3 - %build -%{__python2} setup.py build +%py2_build %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif # with_python3 +%py3_build +%endif %install @@ -94,13 +97,21 @@ popd # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -mv %{buildroot}%{_bindir}/unit2 %{buildroot}/%{_bindir}/python3-unit2 +%py3_install +pushd %{buildroot}%{_bindir} +mv unit2 unit2-%{python3_version} +ln -s unit2-%{python3_version} unit2-3 +# compatibility symlink +ln -s unit2-%{python3_version} python3-unit2 popd -%endif # with_python3 +%endif -%{__python2} setup.py install --skip-build --root %{buildroot} +%py2_install +pushd %{buildroot}%{_bindir} +mv unit2 unit2-%{python2_version} +ln -s unit2-%{python2_version} unit2-2 +ln -s unit2-2 unit2 +popd %check @@ -108,28 +119,35 @@ popd %{__python2} -m unittest2 %if 0%{?with_python3} -pushd %{py3dir} %{__python3} -m unittest2 -popd %endif # with_python3 %endif # bootstrap_traceback2 -%files +%files -n python2-%{pypi_name} %doc README.txt %{_bindir}/unit2 +%{_bindir}/unit2-2 +%{_bindir}/unit2-%{python2_version} %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info + %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.txt +%{_bindir}/unit2-3 +%{_bindir}/unit2-%{python3_version} %{_bindir}/python3-unit2 %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif # with_python3 + %changelog +* Thu May 19 2016 Carl George - 1.1.0-5 +- Implement new Python packaging guidelines (python2 subpackage) + * Thu Feb 04 2016 Fedora Release Engineering - 1.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild