]>
Commit | Line | Data |
---|---|---|
1cd2da1a JB |
1 | # |
2 | # Conditional build: | |
230ead43 | 3 | %bcond_without doc # documentation (uses python2, needs repository metadata) |
4ae1ae20 | 4 | %bcond_without tests # py.test tests |
1cd2da1a JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %if %{without python2} | |
9 | %undefine with_doc | |
10 | %endif | |
11 | Summary: rst.linker - Python 2 Sphinx plugin to add links to the changelog | |
12 | Summary(pl.UTF-8): rst.linker - wtyczka Sphinksa dla Pythona 2 do dodawania odnośników do changeloga | |
13 | Name: python-rst.linker | |
91c867bc | 14 | Version: 1.11 |
0592513e | 15 | Release: 3 |
1cd2da1a JB |
16 | License: MIT |
17 | Group: Libraries/Python | |
6759b56c JB |
18 | #Source0Download: https://pypi.org/simple/rst.linker/ |
19 | Source0: https://files.pythonhosted.org/packages/source/r/rst.linker/rst.linker-%{version}.tar.gz | |
91c867bc JB |
20 | # Source0-md5: 9541a7debee1c5b4ac54350696082664 |
21 | URL: https://github.com/jaraco/rst.linker | |
1cd2da1a JB |
22 | %if %{with python2} |
23 | BuildRequires: python-devel >= 1:2.7 | |
230ead43 | 24 | BuildRequires: python-modules >= 1:2.7 |
91c867bc | 25 | BuildRequires: python-setuptools >= 1:31.0.1 |
4ae1ae20 JB |
26 | BuildRequires: python-setuptools_scm >= 1.15.0 |
27 | %if %{with tests} | |
28 | BuildRequires: python-dateutil | |
91c867bc | 29 | BuildRequires: python-importlib_metadata |
4ae1ae20 | 30 | BuildRequires: python-path |
91c867bc JB |
31 | BuildRequires: python-pytest >= 3.5 |
32 | BuildRequires: python-pytest-black-multipy | |
6759b56c | 33 | BuildRequires: python-pytest-flake8 |
230ead43 | 34 | BuildRequires: python-six |
4ae1ae20 | 35 | %endif |
6759b56c JB |
36 | %if %{with doc} |
37 | BuildRequires: python-Sphinx | |
38 | BuildRequires: python-jaraco.packaging >= 3.2 | |
39 | # needs to be already installed | |
40 | BuildRequires: python-rst.linker >= 1.9 | |
41 | %endif | |
1cd2da1a JB |
42 | %endif |
43 | %if %{with python3} | |
44 | BuildRequires: python3-devel >= 1:3.2 | |
230ead43 | 45 | BuildRequires: python3-modules >= 1:3.2 |
91c867bc | 46 | BuildRequires: python3-setuptools >= 1:31.0.1 |
4ae1ae20 JB |
47 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
48 | %if %{with tests} | |
49 | BuildRequires: python3-dateutil | |
91c867bc JB |
50 | %if "%{py3_ver}" < "3.8" |
51 | BuildRequires: python3-importlib_metadata | |
52 | %endif | |
4ae1ae20 | 53 | BuildRequires: python3-path |
91c867bc JB |
54 | BuildRequires: python3-pytest >= 3.5 |
55 | BuildRequires: python3-pytest-black-multipy | |
6759b56c | 56 | BuildRequires: python3-pytest-flake8 |
230ead43 | 57 | BuildRequires: python3-six |
1cd2da1a | 58 | %endif |
4ae1ae20 JB |
59 | %endif |
60 | BuildRequires: rpm-pythonprov | |
61 | BuildRequires: rpmbuild(macros) >= 1.714 | |
1cd2da1a | 62 | Requires: python-Sphinx |
1cd2da1a JB |
63 | BuildArch: noarch |
64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
65 | ||
66 | %description | |
67 | rst.linker is a Sphinx plugin to add links to the changelog. | |
68 | ||
69 | %description -l pl.UTF-8 | |
70 | rst.linker to wtyczka Sphinksa służąca do dodawania odnośników do | |
71 | changeloga. | |
72 | ||
73 | %package -n python3-rst.linker | |
74 | Summary: rst.linker - Python 3 Sphinx plugin to add links to the changelog | |
75 | Summary(pl.UTF-8): rst.linker - wtyczka Sphinksa dla Pythona 3 do dodawania odnośników do changeloga | |
76 | Group: Libraries/Python | |
77 | Requires: python3-Sphinx | |
1cd2da1a JB |
78 | |
79 | %description -n python3-rst.linker | |
80 | rst.linker is a Sphinx plugin to add links to the changelog. | |
81 | ||
82 | %description -n python3-rst.linker -l pl.UTF-8 | |
83 | rst.linker to wtyczka Sphinksa służąca do dodawania odnośników do | |
84 | changeloga. | |
85 | ||
86 | %package apidocs | |
87 | Summary: Documentation for rst.linker module | |
88 | Summary(pl.UTF-8): Dokumentacja do modułu rst.linker | |
89 | Group: Documentation | |
90 | ||
91 | %description apidocs | |
92 | Documentation for rst.linker module. | |
93 | ||
94 | %description apidocs -l pl.UTF-8 | |
95 | Dokumentacja do modułu rst.linker. | |
96 | ||
97 | %prep | |
98 | %setup -q -n rst.linker-%{version} | |
99 | ||
100 | %build | |
101 | %if %{with python2} | |
6759b56c | 102 | %py_build %{?with_doc:build_sphinx} |
1cd2da1a | 103 | |
91c867bc JB |
104 | %if %{with tests} |
105 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
106 | PYTEST_PLUGINS="pytest_black_multipy,pytest_flake8" \ | |
107 | %{__python} -m pytest test_all.py | |
108 | %endif | |
1cd2da1a JB |
109 | %endif |
110 | ||
111 | %if %{with python3} | |
6759b56c | 112 | %py3_build |
4ae1ae20 | 113 | |
91c867bc JB |
114 | %if %{with tests} |
115 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
116 | PYTEST_PLUGINS="pytest_black,pytest_black_multipy,pytest_flake8" \ | |
117 | %{__python3} -m pytest test_all.py | |
118 | %endif | |
1cd2da1a JB |
119 | %endif |
120 | ||
121 | %install | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
124 | %if %{with python2} | |
5e7b6244 | 125 | %py_install |
1cd2da1a JB |
126 | |
127 | %py_postclean | |
128 | %endif | |
129 | ||
130 | %if %{with python3} | |
5e7b6244 | 131 | %py3_install |
1cd2da1a JB |
132 | %endif |
133 | ||
134 | %clean | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
137 | %if %{with python2} | |
138 | %files | |
139 | %defattr(644,root,root,755) | |
6759b56c | 140 | %doc CHANGES.rst LICENSE README.rst |
1cd2da1a | 141 | %dir %{py_sitescriptdir}/rst |
91c867bc JB |
142 | %{py_sitescriptdir}/rst/__init__.py[co] |
143 | %{py_sitescriptdir}/rst/linker.py[co] | |
1cd2da1a JB |
144 | %{py_sitescriptdir}/rst.linker-%{version}-py*.egg-info |
145 | %endif | |
146 | ||
147 | %if %{with python3} | |
148 | %files -n python3-rst.linker | |
149 | %defattr(644,root,root,755) | |
6759b56c | 150 | %doc CHANGES.rst LICENSE README.rst |
1cd2da1a | 151 | %dir %{py3_sitescriptdir}/rst |
91c867bc JB |
152 | %{py3_sitescriptdir}/rst/__init__.py |
153 | %{py3_sitescriptdir}/rst/linker.py | |
1cd2da1a | 154 | %dir %{py3_sitescriptdir}/rst/__pycache__ |
91c867bc JB |
155 | %{py3_sitescriptdir}/rst/__pycache__/__init__.cpython-*.py[co] |
156 | %{py3_sitescriptdir}/rst/__pycache__/linker.cpython-*.py[co] | |
1cd2da1a JB |
157 | %{py3_sitescriptdir}/rst.linker-%{version}-py*.egg-info |
158 | %endif | |
159 | ||
160 | %if %{with doc} | |
161 | %files apidocs | |
162 | %defattr(644,root,root,755) | |
6759b56c | 163 | %doc build-2/sphinx/html/{_static,*.html,*.js} |
1cd2da1a | 164 | %endif |