%global with_python3 1 Name: python-testfixtures Summary: A collection of helpers and mock objects for unit tests and doc tests. Version: 3.0.0 Release: 1%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.simplistix.co.uk/software/python/testfixtures Source0: https://pypi.python.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz BuildArch: noarch BuildRequires: python-devel python-setuptools Requires: python-mock %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools Requires: python3-mock %endif # if with_python3 %description TestFixtures is a collection of helpers and mock objects that are useful when writing unit tests or doc tests. %if 0%{?with_python3} %package -n python3-testfixtures Summary: A collection of helpers and mock objects for unit tests and doc tests. Group: System Environment/Libraries %description -n python3-testfixtures TestFixtures is a collection of helpers and mock objects that are useful when writing unit tests or doc tests. %endif # with_python3 %prep %setup -q -n testfixtures-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %endif # with_python3 %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT popd %endif # with_python3 %files %defattr(-,root,root,-) %doc README.txt %{python_sitelib}/testfixtures* %if 0%{?with_python3} %files -n python3-testfixtures %defattr(-,root,root,-) %doc README.txt %{python3_sitelib}/testfixtures* %endif # with_python3 %changelog * Wed Mar 27 2013 Kushal Das 0.1-1 - Initial package for Fedora