]>
Commit | Line | Data |
---|---|---|
e01687ac JK |
1 | # |
2 | # Conditional build: | |
bfd07881 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
e01687ac JK |
5 | |
6 | %define pypi_name backports.functools_lru_cache | |
7 | ||
8 | Summary: Backport of functools.lru_cache from Python 3.3 | |
bfd07881 | 9 | Summary(pl.UTF-8): Backport functools.lru_cache z Pythona 3.3 |
e01687ac | 10 | Name: python-%{pypi_name} |
bfd07881 | 11 | Version: 1.5 |
4e8226f3 | 12 | Release: 2 |
e01687ac JK |
13 | License: MIT |
14 | Group: Libraries/Python | |
bfd07881 JB |
15 | #Source0Download: https://pypi.org/simple/backports.functools_lru_cache/ |
16 | Source0: https://files.pythonhosted.org/packages/source/b/backports.functools_lru_cache/%{pypi_name}-%{version}.tar.gz | |
17 | # Source0-md5: 20f53f54cd3f04b3346ce75a54959754 | |
e01687ac | 18 | URL: https://github.com/jaraco/backports.functools_lru_cache |
bfd07881 | 19 | BuildRequires: python-modules >= 1:2.6 |
e01687ac | 20 | BuildRequires: python-setuptools |
bfd07881 JB |
21 | BuildRequires: python-setuptools_scm >= 1.15.0 |
22 | %if %{with tests} | |
23 | BuildRequires: python-pytest >= 2.8 | |
24 | %endif | |
e01687ac JK |
25 | BuildRequires: rpm-pythonprov |
26 | BuildRequires: rpmbuild(macros) >= 1.714 | |
bfd07881 JB |
27 | %if %{with doc} |
28 | BuildRequires: python-jaraco.packaging >= 3.2 | |
29 | BuildRequires: python-rst.linker | |
30 | BuildRequires: sphinx-pdg-2 | |
31 | %endif | |
e01687ac | 32 | Requires: python-backports |
bfd07881 | 33 | Requires: python-modules >= 1:2.6 |
e01687ac JK |
34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | Backport of functools.lru_cache from Python 3.3. | |
39 | ||
bfd07881 JB |
40 | %description |
41 | Backport functools.lru_cache z Pythona 3.3. | |
42 | ||
43 | %package apidocs | |
44 | Summary: API documentation for Python backports.functools_lru_cache module | |
45 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona backports.functools_lru_cache | |
46 | Group: Documentation | |
47 | ||
48 | %description apidocs | |
49 | API documentation for Python backports.functools_lru_cache module. | |
50 | ||
51 | %description apidocs -l pl.UTF-8 | |
52 | Dokumentacja API modułu Pythona backports.functools_lru_cache. | |
53 | ||
e01687ac JK |
54 | %prep |
55 | %setup -q -n %{pypi_name}-%{version} | |
56 | ||
57 | %build | |
bfd07881 JB |
58 | %py_build |
59 | ||
60 | %if %{with tests} | |
61 | %{__python} -m pytest tests | |
62 | %endif | |
63 | ||
64 | %if %{with doc} | |
65 | cd docs | |
66 | sphinx-build-2 -b html . _build/html | |
67 | %endif | |
e01687ac JK |
68 | |
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %py_install | |
73 | ||
74 | %py_postclean | |
75 | ||
bfd07881 | 76 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/__init__.* |
e01687ac JK |
77 | |
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %files | |
82 | %defattr(644,root,root,755) | |
bfd07881 | 83 | %doc CHANGES.rst LICENSE README.rst |
e01687ac JK |
84 | %{py_sitescriptdir}/backports/functools_lru_cache.py[co] |
85 | %{py_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info | |
bfd07881 JB |
86 | |
87 | %if %{with doc} | |
88 | %files apidocs | |
89 | %defattr(644,root,root,755) | |
90 | %doc docs/_build/html/{_static,*.html,*.js} | |
91 | %endif |