%if 0%{?rhel} && 0%{?rhel} <= 7
%{!?__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))")}
%else
%global with_python3 1
%endif
%global srcname pytest-cache
Name: python-%{srcname}
Version: 1.0
Release: 7%{?dist}
Summary: Pytest plugin with mechanisms for caching across test runs
License: MIT
URL: https://pypi.python.org/pypi/%{srcname}
Source0: https://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
%description
Pytest plugin with mechanisms for caching across test runs for Python 2.
%package -n python2-%{srcname}
Summary: Pytest plugin with mechanisms for caching across test runs for Python 3
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: pytest
BuildRequires: python-execnet
Requires: pytest
Requires: python-execnet
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
Pytest plugin with mechanisms for caching across test runs for Python 3.
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: Pytest plugin with mechanisms for caching across test runs for Python 3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-execnet
BuildRequires: python3-pytest
Requires: python3-execnet
Requires: python3-pytest
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
Pytest plugin with mechanisms for caching across test runs for Python 3.
%endif # with_python3
%prep
%setup -q -n %{srcname}-%{version}
rm -rf *.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3
%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install
%check
%{__python2} setup.py test
%if 0%{?with_python3}
%{__python3} setup.py test
%endif # with_python3
%files -n python2-%{srcname}
%license LICENSE
%doc CHANGELOG PKG-INFO README.rst
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-%{srcname}
%license LICENSE
%doc CHANGELOG PKG-INFO README.rst
%{python3_sitelib}/pytest_cache*
%{python3_sitelib}/__pycache__/*
%endif # with_python3
%changelog
* Sat Feb 13 2016 Orion Poplawski <orion@cora.nwra.com> - 1.0-7
- Fix provide typo
* Wed Feb 3 2016 Orion Poplawski <orion@cora.nwra.com> - 1.0-6
- Modernize spec
- Fix python3 package file ownership
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon May 19 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Tue Feb 25 2014 Orion Poplawski <orion@cora.nwra.com> - 1.0-1
- Initial package