]>
Commit | Line | Data |
---|---|---|
a9d72cbd AM |
1 | # Conditional build: |
2 | %bcond_without doc # API documentation | |
3 | %bcond_without tests # unit tests | |
4 | ||
5 | %define module natsort | |
6 | Summary: Simple yet flexible natural sorting in Python | |
7 | Summary(pl.UTF-8): - | |
8 | # Name must match the python module/package name (as on pypi or in 'import' statement) | |
9 | Name: python3-%{module} | |
10 | Version: 7.1.1 | |
3db9efb8 | 11 | Release: 2 |
a9d72cbd AM |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | # if pypi: | |
15 | #Source0Download: https://pypi.org/simple/MODULE/ | |
16 | Source0: https://pypi.debian.net/natsort/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 585f58381542884f2cc9c4d73962a08f | |
18 | URL: https://pypi.org/project/natsort/ | |
19 | BuildRequires: python3-modules >= 1:3.2 | |
20 | #BuildRequires: python3-setuptools | |
21 | %if %{with tests} | |
22 | #BuildRequires: python3- | |
23 | %endif | |
24 | BuildRequires: rpm-pythonprov | |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | %if %{with doc} | |
27 | BuildRequires: sphinx-pdg-3 | |
28 | %endif | |
29 | # replace with other requires if defined in setup.py | |
30 | Requires: python3-modules >= 1:3.2 | |
31 | BuildArch: noarch | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | Simple yet flexible natural sorting in Python. | |
36 | ||
37 | %package apidocs | |
38 | Summary: API documentation for Python %{module} module | |
39 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
40 | Group: Documentation | |
41 | ||
42 | %description apidocs | |
43 | API documentation for Python %{module} module. | |
44 | ||
45 | %description apidocs -l pl.UTF-8 | |
46 | Dokumentacja API modułu Pythona %{module}. | |
47 | ||
48 | %prep | |
49 | %setup -q -n %{module}-%{version} | |
50 | ||
51 | %build | |
52 | %py3_build | |
53 | ||
54 | %if %{with tests} | |
55 | %{__python3} -m pytest tests | |
56 | %endif | |
57 | ||
58 | %if %{with doc} | |
59 | %{_bindir}/tox -e docs | |
60 | %endif | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | ||
65 | %py3_install | |
66 | ||
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
72 | %doc CHANGELOG.md README.rst | |
73 | %attr(755,root,root) %{_bindir}/natsort | |
74 | %dir %{py3_sitescriptdir}/%{module} | |
75 | %{py3_sitescriptdir}/%{module}/*.py | |
76 | %{py3_sitescriptdir}/%{module}/__pycache__ | |
77 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
78 | %dir %{py3_sitescriptdir}/%{module}/compat | |
79 | %{py3_sitescriptdir}/%{module}/compat/*.py | |
80 | %{py3_sitescriptdir}/%{module}/compat/__pycache__ | |
81 | ||
82 | %if %{with doc} | |
83 | %files apidocs | |
84 | %defattr(644,root,root,755) | |
85 | %doc docs/_build/html/* | |
86 | %endif |