diff --git a/python-cachetools.spec b/python-cachetools.spec index d4e6e98..4145dde 100644 --- a/python-cachetools.spec +++ b/python-cachetools.spec @@ -1,24 +1,15 @@ -%if 0%{?fedora} -%bcond_without python3 -%else -%bcond_with python3 -%endif +%global srcname cachetools -Name: python-cachetools +Name: python-%{srcname} Version: 3.1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Extensible memoizing collections and decorators License: MIT -URL: https://pypi.python.org/pypi/cachetools -Source0: https://pypi.python.org/packages/source/c/cachetools/cachetools-%{version}.tar.gz +URL: https://pypi.python.org/pypi/%{srcname} +Source0: %{pypi_source} BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-setuptools -%if %{with python3} -BuildRequires: python3-devel -%endif # with python3 %global _description\ This module provides various memoizing collections and decorators,\ @@ -32,95 +23,37 @@ and method calls.\ %description %_description -%package -n python2-cachetools -Summary: %summary -%{?python_provide:%python_provide python2-cachetools} - -%description -n python2-cachetools %_description - -%if %{with python3} -%package -n python3-cachetools -Summary: Extensible memoizing collections and decorators - -%description -n python3-cachetools -This module provides various memoizing collections and decorators, -including a variant of the Python 3 Standard Library @lru_cache -function decorator. - -This module provides multiple cache implementations based on different -cache algorithms, as well as decorators for easily memoizing function -and method calls. - -%endif # with python3 +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-devel +%{?python_provide:%python_provide python3-%{srcname}} +%description -n python3-%{srcname} %_description %prep -%setup -qc -rm -rf cachetools-%{version}/cachetools.egg-info -mv cachetools-%{version} python2 - -%if %{with python3} -cp -a python2 python3 -%endif # with python3 - +%autosetup -n %{srcname}-%{version} %build -pushd python2 -%{__python2} setup.py build -popd - -%if %{with python3} -pushd python3 -%{__python3} setup.py build -popd -%endif # with python3 - +%py3_build %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). -%if %{with python3} -pushd python3 -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -popd -%endif # with python3 - -pushd python2 -%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -popd - +%py3_install %check -pushd python2 -%{__python2} setup.py test -popd - -%if %{with python3} -pushd python3 -%{__python2} setup.py test -popd -%endif - - -%files -n python2-cachetools -%doc python2/CHANGES.rst python2/PKG-INFO python2/README.rst -%license python2/LICENSE -# For noarch packages: sitelib -%{python2_sitelib}/cachetools -%{python2_sitelib}/cachetools-%{version}-py%{python2_version}.egg-info - -%if %{with python3} -%files -n python3-cachetools -%doc python3/CHANGES.rst python3/PKG-INFO python3/README.rst -%license python3/LICENSE -# For noarch packages: sitelib -%{python3_sitelib}/cachetools -%{python3_sitelib}/cachetools-%{version}-py%{python3_version}.egg-info -%endif # with python3 +%{__python3} setup.py test + +%files -n python3-%{srcname} +%license LICENSE +%doc CHANGES.rst PKG-INFO README.rst +%{python3_sitelib}/%{srcname}-*.egg-info/ +%{python3_sitelib}/%{srcname}/ %changelog +* Mon Feb 4 2019 John Eckersberg - 3.1.0-3 +- Remove python2 subpackage (rhbz#1671973) +- Modernize spec from latest packaging guidelines + * Sat Feb 02 2019 Fedora Release Engineering - 3.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild