%if 0%{?fedora} || 0%{?rhel} >= 8 %global with_py3 1 %endif %global srcname fastcache Name: python-%{srcname} Version: 1.0.2 Release: 4%{?dist} Summary: C implementation of python3 lru_cache License: MIT URL: https://github.com/pbrady/%{srcname} Source0: https://github.com/pbrady/%{srcname}/archive/v%{version}.tar.gz BuildRequires: pycmd BuildRequires: pytest BuildRequires: python2-devel BuildRequires: python-setuptools %if 0%{?with_py3} BuildRequires: python3-pycmd BuildRequires: python3-pytest BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %{?python_provide:%python_provide python2-%{srcname}} %description This package contains a C implementation of the python 3 lru_cache. It passes all tests in the standard library for functools.lru_cache. %if 0%{?with_py3} %package -n python3-%{srcname} Summary: C implementation of python3 lru_cache %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} This package contains a C implementation of the python 3 lru_cache. It passes all tests in the standard library for functools.lru_cache. %endif %prep %setup -q -c %if 0%{?with_py3} # Prepare for a python3 build cp -a %{srcname}-%{version} python3-%{srcname}-%{version} %endif %build # Python 2 build pushd %{srcname}-%{version} %py2_build "--define=WITH_THREAD" popd %if 0%{?with_py3} # Python 3 build pushd python3-%{srcname}-%{version} %py3_build "--define=WITH_THREAD" popd %endif %install # Python 2 install pushd %{srcname}-%{version} %{py2_install} chmod 0755 %{buildroot}%{python2_sitearch}/%{srcname}/*.so popd %if 0%{?with_py3} # Python 3 install pushd python3-%{srcname}-%{version} %{py3_install} chmod 0755 %{buildroot}%{python3_sitearch}/%{srcname}/*.so popd %endif %check # Python 2 tests pushd %{srcname}-%{version} py.cleanup-%{python2_version} -p export PYTHONPATH=build/lib.linux-%{_arch}-%{python2_version}/fastcache/tests py.test-%{python2_version} -v --ignore=fastcache/tests popd %if 0%{?with_py3} # Python 3 tests pushd python3-%{srcname}-%{version} py.cleanup-%{python3_version} -p export PYTHONPATH=build/lib.linux-%{_arch}-%{python3_version}/fastcache/tests py.test-%{python3_version} -v --ignore=fastcache/tests popd %endif %files %doc %{srcname}-%{version}/CHANGELOG %{srcname}-%{version}/README.md %license %{srcname}-%{version}/LICENSE %{python2_sitearch}/%{srcname}/ %{python2_sitearch}/%{srcname}*.egg-info/ %exclude %{python2_sitearch}/%{srcname}/tests %if 0%{?with_py3} %files -n python3-%{srcname} %doc %{srcname}-%{version}/CHANGELOG %{srcname}-%{version}/README.md %license %{srcname}-%{version}/LICENSE %{python3_sitearch}/%{srcname}/ %{python3_sitearch}/%{srcname}*.egg-info/ %exclude %{python3_sitearch}/%{srcname}/tests %endif %changelog * Tue Nov 10 2015 Orion Poplawski - 1.0.2-4 - Use python2/3_version macros * Tue Nov 10 2015 Fedora Release Engineering - 1.0.2-4 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Thu Jun 18 2015 Fedora Release Engineering - 1.0.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon Dec 1 2014 Jerry James - 1.0.2-2 - Be more verbose in the file listing - Run the tests verbosely * Fri Nov 21 2014 Jerry James - 1.0.2-1 - Initial RPM