]>
Commit | Line | Data |
---|---|---|
aced4f00 ER |
1 | # |
2 | # Conditional build: | |
4b89daab JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
0f444658 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
aced4f00 ER |
7 | |
8 | %define module repoze.lru | |
9 | Summary: A tiny LRU cache implementation and decorator | |
4b89daab | 10 | Summary(pl.UTF-8): Mała implementacja pamięci podręcznej LRU z dekoratorem |
aced4f00 | 11 | Name: python-%{module} |
4b89daab JB |
12 | Version: 0.7 |
13 | Release: 1 | |
aced4f00 ER |
14 | License: BSD-derived (http://www.repoze.org/LICENSE.txt) |
15 | Group: Libraries/Python | |
4b89daab JB |
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/ | |
0f444658 | 19 | %if %{with python2} |
4b89daab JB |
20 | BuildRequires: python-modules >= 1:2.7 |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-coverage | |
24 | BuildRequires: python-nose | |
25 | %endif | |
0f444658 JB |
26 | %endif |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules >= 1:3.4 | |
29 | BuildRequires: python3-setuptools | |
30 | %if %{with tests} | |
31 | BuildRequires: python3-coverage | |
32 | BuildRequires: python3-nose | |
33 | %endif | |
34 | %endif | |
aced4f00 | 35 | BuildRequires: rpm-pythonprov |
4b89daab JB |
36 | BuildRequires: rpmbuild(macros) >= 1.714 |
37 | %if %{with doc} | |
38 | BuildRequires: sphinx-pdg-2 | |
39 | %endif | |
40 | Requires: python-modules >= 1:2.7 | |
aced4f00 ER |
41 | BuildArch: noarch |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
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. | |
48 | ||
4b89daab JB |
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. | |
54 | ||
0f444658 JB |
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 | |
60 | ||
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. | |
65 | ||
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. | |
71 | ||
4b89daab JB |
72 | %package apidocs |
73 | Summary: API documentation for Python repoze.lru module | |
74 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona repoze.lru | |
75 | Group: Documentation | |
76 | ||
77 | %description apidocs | |
78 | API documentation for Python repoze.lru module. | |
79 | ||
80 | %description apidocs -l pl.UTF-8 | |
81 | Dokumentacja API modułu Pythona repoze.lru. | |
82 | ||
aced4f00 ER |
83 | %prep |
84 | %setup -q -n %{module}-%{version} | |
85 | ||
86 | %build | |
0f444658 | 87 | %if %{with python2} |
4b89daab | 88 | %py_build %{?with_tests:test} |
0f444658 JB |
89 | %endif |
90 | ||
91 | %if %{with python3} | |
92 | %py3_build %{?with_tests:test} | |
93 | %endif | |
aced4f00 | 94 | |
4b89daab JB |
95 | %if %{with doc} |
96 | PYTHONPATH=$(pwd) \ | |
97 | %{__make} -C docs html \ | |
98 | SPHINXBUILD=sphinx-build-2 | |
99 | %endif | |
aced4f00 ER |
100 | |
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
4b89daab | 103 | |
0f444658 | 104 | %if %{with python2} |
453ce069 | 105 | %py_install |
aced4f00 ER |
106 | |
107 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/repoze/lru/tests.py* | |
aced4f00 | 108 | %py_postclean |
0f444658 JB |
109 | %endif |
110 | ||
111 | %if %{with python3} | |
112 | %py3_install | |
113 | ||
114 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/repoze/lru/tests.py | |
115 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/repoze/lru/__pycache__/tests.*.py* | |
116 | %endif | |
aced4f00 ER |
117 | |
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
0f444658 | 121 | %if %{with python2} |
aced4f00 ER |
122 | %files |
123 | %defattr(644,root,root,755) | |
4b89daab JB |
124 | %doc COPYRIGHT.txt LICENSE.txt README.rst |
125 | # XXX: shared with repoze.* | |
126 | %dir %{py_sitescriptdir}/repoze | |
0f444658 JB |
127 | %{py_sitescriptdir}/repoze/lru |
128 | %{py_sitescriptdir}/repoze.lru-%{version}-py*-nspkg.pth | |
129 | %{py_sitescriptdir}/repoze.lru-%{version}-py*.egg-info | |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
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 | |
141 | %endif | |
4b89daab JB |
142 | |
143 | %if %{with doc} | |
144 | %files apidocs | |
145 | %defattr(644,root,root,755) | |
146 | %doc docs/_build/html/{_static,*.html,*.js} | |
147 | %endif |