%global pypi_name extras Name: python-extras Version: 0.0.3 Release: 3%{?dist} Summary: Useful extra bits for Python License: MIT URL: https://github.com/testing-cabal/extras Source0: %{pypi_source} BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %description extras is a set of extensions to the Python standard library, originally written to make the code within testtools cleaner, but now split out for general use outside of a testing context. %package -n python%{python3_pkgversion}-extras Summary: Useful extra bits for Python %{?python_provide:%python_provide python%{python3_pkgversion}-extras} %description -n python%{python3_pkgversion}-extras extras is a set of extensions to the Python standard library, originally written to make the code within testtools cleaner, but now split out for general use outside of a testing context. %prep %setup -q -n extras-%{version} # Remove bundled egg-info rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' %build %py2_build pushd %{py3dir} %py3_build popd %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). pushd %{py3dir} %py3_install popd %py2_install %files %license LICENSE %doc NEWS README.rst # For noarch packages: sitelib %{python_sitelib}/* %files -n python%{python3_pkgversion}-extras %license LICENSE %doc NEWS README.rst %{python3_sitelib}/* %changelog * Sun Feb 9 2020 Scott K Logan - 0.0.3-3 - Add python 3 subpackage for EPEL 7 * Wed May 29 2013 Matthias Runge - 0.0.3-2 - spec cleanup and enable tests * Wed May 1 2013 Michel Salim - 0.0.3-1 - Initial package