# needed for epel6 %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif # enable python3 on fedora %if 0%{?fedora} || 0%{?epel} >= 7 %bcond_without python3 %else %bcond_with python3 %endif %global srcname pretend %global sum A library for stubbing in Python %global pkgdesc \ Pretend is a library to make stubbing with Python easier. Name: python-pretend Version: 1.0.8 Release: 4%{?dist} Summary: %{sum} Group: Development/Libraries License: BSD URL: https://github.com/alex/pretend Source0: https://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: python-srpm-macros %if %{with python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if 0%{?with_python3_other} BuildRequires: python%{python3_other_pkgversion}-devel BuildRequires: python%{python3_other_pkgversion}-setuptools %endif %endif # with_python3 %description %{pkgdesc} %if %{with python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} %{pkgdesc} %if 0%{?with_python3_other} %package -n python%{python3_other_pkgversion}-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}} %description -n python%{python3_other_pkgversion}-%{srcname} %{pkgdesc} %endif %endif # with_python3 %prep %autosetup -n %{srcname}-%{version} # Delete upstream supplied egg-info rm -rf *.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %if 0%{?with_python3_other} %py3_other_build %endif %endif # with_python3 %install %py2_install %if 0%{?with_python3} %py3_install %if 0%{?with_python3_other} %py3_other_install %endif %endif # with_python3 %files %doc PKG-INFO README.rst LICENSE.rst %{python2_sitelib}/pretend.py* %{python2_sitelib}/pretend-%{version}-py2.?.egg-info %if %{with python3} %files -n python%{python3_pkgversion}-%{srcname} %doc PKG-INFO README.rst LICENSE.rst %{python3_sitelib}/%{srcname}.py %{python3_sitelib}/__pycache__/%{srcname}.cpython-3?.*py* %{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info %if 0%{?with_python3_other} %files -n python%{python3_other_pkgversion}-%{srcname} %doc PKG-INFO README.rst LICENSE.rst %{python3_other_sitelib}/%{srcname}.py %{python3_other_sitelib}/__pycache__/%{srcname}.cpython-3?.*py* %{python3_other_sitelib}/%{srcname}-%{version}-py3.?.egg-info %endif %endif # with_python3 %changelog * Fri Mar 08 2019 Troy Dawson - 1.0.8-4 - Rebuilt to change main python from 3.4 to 3.6 * Wed Aug 16 2017 Aurelien Bompard - 1.0.8-3 - Build for Python3 in EPEL: http://fedoraproject.org/wiki/PackagingDrafts:Python3EPEL - Modernize the spec a bit (build and install macros) * Sat Nov 22 2014 Piotr Popieluch - 1.0.8-2 - Added epel support * Mon Oct 20 2014 Piotr Popieluch - 1.0.8-1 - Initial package