%global with_python3 1 %if 0%{?rhel} && 0%{?rhel} <= 7 %global with_python3 0 %endif %global pypi_name spec Name: python-%{pypi_name} Version: 1.0.0 Release: 1%{?dist} Summary: Specification-style output for python2-nose License: MIT URL: https://github.com/bitprophet/spec Source0: https://pypi.python.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # LICENSE file from Github # https://raw.githubusercontent.com/bitprophet/spec/master/LICENSE Source1: LICENSE BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif # if with_python3 Requires: python-nose >= 1.3 Requires: python-six %description spec is a Python 2 testing tool that provides: * Colorized, specification style output * Colorized tracebacks and summary * Test-running CLI tool which enables useful non-default options and implements relaxed test discovery for less test_annoying.py:TestBoilerplate.test_code and more readable.py:Classes.and_methods. %if 0%{?with_python3} %package -n python3-spec Summary: Specification-style output for python3-nose Group: Development/Libraries Requires: python3-nose >= 1.3 Requires: python3-six %description -n python3-spec spec is a Python 3 testing tool that provides: * Colorized, specification style output * Colorized tracebacks and summary * Test-running CLI tool which enables useful non-default options and implements relaxed test discovery for less test_annoying.py:TestBoilerplate.test_code and more readable.py:Classes.and_methods. %endif # with_python3 %prep %setup -q -n %{pypi_name}-%{version} cp -p %{SOURCE1} . # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %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 %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} popd %endif # with_python3 %{__python2} setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} # Upstream queried to include license file %files %{!?_licensedir:%global license %%doc} %license LICENSE %{_bindir}/spec %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-spec %{!?_licensedir:%global license %%doc} %license LICENSE %{_bindir}/spec %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif # with_python3 %changelog * Sat Mar 28 2015 Eduardo Mayorga Téllez - 1.0.0-1 - Update to 1.0.0 * Sun Aug 03 2014 Eduardo Mayorga Téllez - 0.11.1-2 - Changing Requires from python2- to python- * Tue Jul 29 2014 Eduardo Mayorga Téllez - 0.11.1-1 - Initial packaging