]>
Commit | Line | Data |
---|---|---|
85ee24a1 AM |
1 | # Conditional build: |
2 | %bcond_without doc # API documentation | |
3 | # Tests need real rt server | |
4 | %bcond_with tests # unit tests | |
5 | ||
6 | %define module rt | |
7 | Summary: Python interface to Request Tracker API | |
8 | Summary(pl.UTF-8): - | |
9 | Name: python3-%{module} | |
b17486c8 AM |
10 | Version: 3.0.0 |
11 | Release: 1 | |
85ee24a1 AM |
12 | License: GPL v3 |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.debian.net/rt/%{module}-%{version}.tar.gz | |
b17486c8 | 15 | # Source0-md5: d435c28902ed9e50b567adee4b1d8e27 |
85ee24a1 AM |
16 | URL: https://github.com/CZ-NIC/python-rt |
17 | BuildRequires: python3-modules >= 1:3.2 | |
18 | %if %{with tests} | |
19 | BuildRequires: python3-nose | |
20 | %endif | |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with doc} | |
b17486c8 AM |
24 | BuildRequires: python3-furo |
25 | BuildRequires: python3-sphinx_copybutton | |
85ee24a1 AM |
26 | BuildRequires: sphinx-pdg-3 |
27 | %endif | |
28 | Requires: python3-modules >= 1:3.2 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Python implementation of REST API described here: | |
34 | https://rt-wiki.bestpractical.com/wiki/REST. | |
35 | ||
36 | %package apidocs | |
37 | Summary: API documentation for Python %{module} module | |
38 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
39 | Group: Documentation | |
40 | ||
41 | %description apidocs | |
42 | API documentation for Python %{module} module. | |
43 | ||
44 | %description apidocs -l pl.UTF-8 | |
45 | Dokumentacja API modułu Pythona %{module}. | |
46 | ||
47 | %prep | |
48 | %setup -q -n %{module}-%{version} | |
49 | ||
50 | %build | |
51 | %py3_build | |
52 | ||
53 | %if %{with tests} | |
54 | PYTHONPATH=$(pwd) \ | |
55 | %{__python3} test_rt.py | |
56 | %endif | |
57 | ||
58 | %if %{with doc} | |
59 | %{__make} -C doc html \ | |
60 | SPHINXBUILD=sphinx-build-3 | |
61 | rm -rf docs/_build/html/_sources | |
62 | %endif | |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %py3_install | |
68 | ||
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %files | |
73 | %defattr(644,root,root,755) | |
b17486c8 | 74 | %doc AUTHORS CHANGELOG.md README.rst |
85ee24a1 AM |
75 | %dir %{py3_sitescriptdir}/%{module} |
76 | %{py3_sitescriptdir}/%{module}/*.py | |
77 | # PEP-561 | |
78 | %{py3_sitescriptdir}/%{module}/py.typed | |
79 | %{py3_sitescriptdir}/%{module}/__pycache__ | |
80 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
81 | ||
82 | %if %{with doc} | |
83 | %files apidocs | |
84 | %defattr(644,root,root,755) | |
85 | %doc doc/_build/html/* | |
86 | %endif |