%global modname repoze.lru %if 0%{?fedora} || 0%{?rhel} > 7 %{lua:posix.setenv("RHEL_ALLOW_PYTHON2_FOR_BUILD", 1)} %global with_python3 1 %endif Name: python-repoze-lru Version: 0.4 Release: 9%{?dist} Summary: A tiny LRU cache implementation and decorator Group: Development/Libraries License: BSD URL: http://pypi.python.org/pypi/repoze.lru Source0: http://pypi.python.org/packages/source/r/repoze.lru/%{modname}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %description repoze.lru is a LRU (least recently used) cache implementation. Keys and values that are not used frequently will be evicted from the cache faster than keys and values that are used frequently. %package -n python2-repoze-lru summary: A tiny LRU cache implementation and decorator Group: Development/Libraries Provides: %{name} = %{version}-%{release} Obsoletes: %{name} < %{version}-%{release} %description -n python2-repoze-lru repoze.lru is a LRU (least recently used) cache implementation. Keys and values that are not used frequently will be evicted from the cache faster than keys and values that are used frequently. %if 0%{?with_python3} %package -n python3-repoze-lru Summary: A tiny LRU cache implementation and decorator Group: Development/Libraries %description -n python3-repoze-lru repoze.lru is a LRU (least recently used) cache implementation. Keys and values that are not used frequently will be evicted from the cache faster than keys and values that are used frequently. %endif %prep %setup -q -n %{modname}-%{version} rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %check %{__python2} setup.py test %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py test popd %endif %files -n python2-repoze-lru %doc README.txt LICENSE.txt %{python2_sitelib}/repoze/lru %{python2_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-repoze-lru %doc README.txt LICENSE.txt %{python3_sitelib}/repoze/lru %{python3_sitelib}/%{modname}-%{version}* %endif %changelog * Thu Jan 17 2019 Lon Hohberger - 0.4-9 - RHEL8-ism - Use python2 subpackage * Thu Jun 18 2015 Fedora Release Engineering - 0.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 14 2014 Bohuslav Kabrda - 0.4-6 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Fri Dec 06 2013 Pierre-Yves Chibon fr - 0.4-5 - Change BR from python-setuptools-devel to python-setuptools See https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel * Sun Aug 04 2013 Fedora Release Engineering - 0.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Mon Feb 11 2013 Ralph Bean - 0.4-3 - Removed clean section. - Removed defattr. - Removed removing of buildroot in install section. - Added removal of egg-info in prep section. - Added python3 subpackage. * Sat Jul 21 2012 Fedora Release Engineering - 0.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Mar 13 2012 Luke Macken - 0.4-1 - Update to 0.4 * Sat Jan 14 2012 Fedora Release Engineering - 0.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Wed Jan 2 2010 Luke Macken - 0.3-1 - Initial package