3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module repoze.lru
9 Summary: A tiny LRU cache implementation and decorator
10 Summary(pl.UTF-8): Mała implementacja pamięci podręcznej LRU z dekoratorem
11 Name: python-%{module}
14 License: BSD-derived (http://www.repoze.org/LICENSE.txt)
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/r/repoze.lru/repoze.lru-%{version}.tar.gz
17 # Source0-md5: c08cc030387e0b1fc53c5c7d964b35e2
18 URL: https://pypi.org/project/repoze.lru/
20 BuildRequires: python-modules >= 1:2.7
21 BuildRequires: python-setuptools
23 BuildRequires: python-coverage
24 BuildRequires: python-nose
28 BuildRequires: python3-modules >= 1:3.4
29 BuildRequires: python3-setuptools
31 BuildRequires: python3-coverage
32 BuildRequires: python3-nose
35 BuildRequires: rpm-pythonprov
36 BuildRequires: rpmbuild(macros) >= 1.714
38 BuildRequires: sphinx-pdg-2
40 Requires: python-modules >= 1:2.7
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 repoze.lru is a LRU (least recently used) cache implementation. Keys
46 and values that are not used frequently will be evicted from the cache
47 faster than keys and values that are used frequently.
49 %description -l pl.UTF-8
50 repoze.lru to implementacja pamięci podręcznej LRU (least recently
51 used - z zastępowaniem najdawniej używanych elementów). Klucze i
52 wartości rzadziej używane będą usuwane z pamięci podręcznej szybciej,
53 niż klucze i wartości używane częściej.
55 %package -n python3-%{module}
56 Summary: A tiny LRU cache implementation and decorator
57 Summary(pl.UTF-8): Mała implementacja pamięci podręcznej LRU z dekoratorem
58 Group: Libraries/Python
59 Requires: python3-modules >= 1:3.2
61 %description -n python3-%{module}
62 repoze.lru is a LRU (least recently used) cache implementation. Keys
63 and values that are not used frequently will be evicted from the cache
64 faster than keys and values that are used frequently.
66 %description -n python3-%{module} -l pl.UTF-8
67 repoze.lru to implementacja pamięci podręcznej LRU (least recently
68 used - z zastępowaniem najdawniej używanych elementów). Klucze i
69 wartości rzadziej używane będą usuwane z pamięci podręcznej szybciej,
70 niż klucze i wartości używane częściej.
73 Summary: API documentation for Python repoze.lru module
74 Summary(pl.UTF-8): Dokumentacja API modułu Pythona repoze.lru
78 API documentation for Python repoze.lru module.
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API modułu Pythona repoze.lru.
84 %setup -q -n %{module}-%{version}
88 %py_build %{?with_tests:test}
92 %py3_build %{?with_tests:test}
97 %{__make} -C docs html \
98 SPHINXBUILD=sphinx-build-2
102 rm -rf $RPM_BUILD_ROOT
107 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/repoze/lru/tests.py*
114 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/repoze/lru/tests.py
115 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/repoze/lru/__pycache__/tests.*.py*
119 rm -rf $RPM_BUILD_ROOT
123 %defattr(644,root,root,755)
124 %doc COPYRIGHT.txt LICENSE.txt README.rst
125 # XXX: shared with repoze.*
126 %dir %{py_sitescriptdir}/repoze
127 %{py_sitescriptdir}/repoze/lru
128 %{py_sitescriptdir}/repoze.lru-%{version}-py*-nspkg.pth
129 %{py_sitescriptdir}/repoze.lru-%{version}-py*.egg-info
133 %files -n python3-%{module}
134 %defattr(644,root,root,755)
135 %doc COPYRIGHT.txt LICENSE.txt README.rst
136 # XXX: shared with repoze.*
137 %dir %{py3_sitescriptdir}/repoze
138 %{py3_sitescriptdir}/repoze/lru
139 %{py3_sitescriptdir}/repoze.lru-%{version}-py*-nspkg.pth
140 %{py3_sitescriptdir}/repoze.lru-%{version}-py*.egg-info
145 %defattr(644,root,root,755)
146 %doc docs/_build/html/{_static,*.html,*.js}