%if 0%{?fedora} %global with_python3 1 %endif #fedora %global pypi_name versiontools Name: python-versiontools Version: 1.9.1 Release: 7%{?dist} Summary: Smart replacement for plain tuple used in __version__ License: LGPLv3 URL: https://launchpad.net/versiontools Source0: http://pypi.python.org/packages/source/v/versiontools/versiontools-1.9.1.tar.gz # Update tests for python 3.4 Patch0: versiontools-1.9.1-py34-tests.patch BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: python-sphinx BuildRequires: python-nose %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-sphinx BuildRequires: python3-nose %endif # with_python3 %description %{summary} %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Smart replacement for plain tuple used in __version__ %description -n python3-%{pypi_name} %{summary} %endif # with_python3 %prep %setup -q -n %{pypi_name}-%{version} %patch0 -p0 # remove bundled egg-info rm -rf %{pypi_name}.egg-info # generate html docs sphinx-build doc html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} pushd %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' popd %endif # with_python3 %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif # with_python3 %check PYTHONPATH="${PWD}" %{__python} setup.py nosetests %if 0%{?with_python3} pushd %{py3dir} PYTHONPATH="${PWD}" %{__python3} setup.py nosetests popd %endif # with_python3 %files %doc html %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py2*.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc html %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py3*.egg-info %endif # with_python3 %changelog * Wed May 27 2015 Adam Miller - 1.9.1-7 - Update package to provide python3 version as well * Sun Jun 08 2014 Fedora Release Engineering - 1.9.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sun Aug 04 2013 Fedora Release Engineering - 1.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu Feb 14 2013 Fedora Release Engineering - 1.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Jul 21 2012 Fedora Release Engineering - 1.9.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Fri May 04 2012 Bohuslav Kabrda - 1.9.1-2 - Be more explicit in %%files section. * Thu May 03 2012 Bohuslav Kabrda - 1.9.1-1 - Initial package.