]>
Commit | Line | Data |
---|---|---|
140ca651 ER |
1 | # |
2 | # Conditional build: | |
9f4131a8 | 3 | %bcond_without doc # Sphinx documentation |
6255cbf2 | 4 | %bcond_with tests # test target [fails on one wheel/wsgi test] |
9f4131a8 JB |
5 | %bcond_with bootstrap # disable tests for bootstrap (circular build dependencies) |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
9 | %if %{with bootstrap} | |
10 | %undefine with_tests | |
9264f4e6 | 11 | %undefine with_doc |
9f4131a8 | 12 | %endif |
140ca651 ER |
13 | %define module pbr |
14 | Summary: Python Build Reasonableness | |
d89984a8 | 15 | Summary(pl.UTF-8): Python Build Reasonableness - rozsądne budowanie modułów pythonowych |
140ca651 | 16 | Name: python-%{module} |
5b8de432 JB |
17 | Version: 5.8.1 |
18 | Release: 1 | |
140ca651 ER |
19 | License: Apache v2.0 |
20 | Group: Libraries/Python | |
9264f4e6 JB |
21 | #Source0Download: https://pypi.org/simple/pbr/ |
22 | Source0: https://files.pythonhosted.org/packages/source/p/pbr/%{module}-%{version}.tar.gz | |
5b8de432 | 23 | # Source0-md5: 9ab99a85202af94990ef44ebcd2bf196 |
d89984a8 | 24 | URL: https://launchpad.net/pbr |
140ca651 | 25 | BuildRequires: rpm-pythonprov |
d89984a8 | 26 | BuildRequires: rpmbuild(macros) >= 1.714 |
140ca651 | 27 | %if %{with python2} |
9264f4e6 | 28 | BuildRequires: python-devel >= 1:2.7 |
140ca651 | 29 | %if %{with tests} |
9264f4e6 JB |
30 | BuildRequires: python-coverage >= 4.0 |
31 | BuildRequires: python-fixtures >= 3.0.0 | |
a62517a0 | 32 | BuildRequires: python-mock >= 2.0.0 |
9264f4e6 | 33 | BuildRequires: python-reno >= 2.5.0 |
5b8de432 | 34 | BuildRequires: python-six >= 1.12.0 |
a62517a0 | 35 | BuildRequires: python-stestr >= 2.1.0 |
140ca651 | 36 | BuildRequires: python-testrepository >= 0.0.18 |
9264f4e6 | 37 | BuildRequires: python-testresources >= 2.0.0 |
d89984a8 | 38 | BuildRequires: python-testscenarios >= 0.4 |
9264f4e6 | 39 | BuildRequires: python-testtools >= 2.2.0 |
5b8de432 | 40 | BuildRequires: python-virtualenv >= 20.0.3 |
a62517a0 | 41 | BuildRequires: python-wheel >= 0.32.0 |
d89984a8 | 42 | %endif |
140ca651 ER |
43 | %endif |
44 | %if %{with python3} | |
a62517a0 | 45 | BuildRequires: python3-devel >= 1:3.5 |
d89984a8 | 46 | %if %{with tests} |
9264f4e6 JB |
47 | BuildRequires: python3-coverage >= 4.0 |
48 | BuildRequires: python3-fixtures >= 3.0.0 | |
5b8de432 | 49 | %if "%{py3_ver}" >= "3.6" |
a62517a0 | 50 | BuildRequires: python3-hacking >= 1.1.0 |
5b8de432 JB |
51 | BuildRequires: python3-hacking < 4.0.0 |
52 | %endif | |
9264f4e6 | 53 | BuildRequires: python3-reno >= 2.5.0 |
5b8de432 | 54 | BuildRequires: python3-six >= 1.12.0 |
a62517a0 | 55 | BuildRequires: python3-stestr >= 2.1.0 |
d89984a8 | 56 | BuildRequires: python3-testrepository >= 0.0.18 |
9264f4e6 | 57 | BuildRequires: python3-testresources >= 2.0.0 |
d89984a8 | 58 | BuildRequires: python3-testscenarios >= 0.4 |
9264f4e6 | 59 | BuildRequires: python3-testtools >= 2.2.0 |
5b8de432 | 60 | BuildRequires: python3-virtualenv >= 20.0.3 |
a62517a0 | 61 | BuildRequires: python3-wheel >= 0.32.0 |
d89984a8 | 62 | %endif |
140ca651 | 63 | %endif |
9264f4e6 JB |
64 | %if %{with doc} |
65 | BuildRequires: python3-openstackdocstheme >= 1.18.1 | |
a62517a0 | 66 | BuildRequires: python3-reno >= 2.5.0 |
5b8de432 | 67 | BuildRequires: python3-six >= 1.12.0 |
a62517a0 | 68 | BuildRequires: python3-sphinxcontrib-apidoc >= 0.2.0 |
9264f4e6 JB |
69 | BuildRequires: sphinx-pdg-3 >= 1.6.2 |
70 | %endif | |
a62517a0 | 71 | Requires: python-modules >= 1:2.7 |
140ca651 ER |
72 | BuildArch: noarch |
73 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
74 | ||
75 | %description | |
76 | PBR is a library that injects some useful and sensible default | |
77 | behaviors into your setuptools run. It started off life as the chunks | |
78 | of code that were copied between all of the OpenStack projects. Around | |
79 | the time that OpenStack hit 18 different projects each with at least 3 | |
80 | active branches, it seems like a good time to make that code into a | |
81 | proper re-usable library. | |
82 | ||
d89984a8 JB |
83 | %description -l pl.UTF-8 |
84 | PBR to biblioteka wstrzykująca trochę przydatnych i sensownych | |
85 | domyślnych zachowań przy uruchomieniu setuptools. Początki wywodzą się | |
86 | z fragmentów kodu kopiowanych między wszystkimi projektami OpenStacka. | |
87 | Kiedy OpenStack dorobił się 18 różnych projektów, z których każdy miał | |
88 | przynajmniej 3 aktywne gałęzie, uznano to za dobry moment na | |
89 | wydzielenie kodu do biblioteki. | |
90 | ||
140ca651 ER |
91 | %package -n python3-pbr |
92 | Summary: Python Build Reasonableness | |
d89984a8 | 93 | Summary(pl.UTF-8): Python Build Reasonableness - rozsądne budowanie modułów pythonowych |
140ca651 | 94 | Group: Libraries/Python |
a62517a0 | 95 | Requires: python3-modules >= 1:3.5 |
5b8de432 | 96 | Conflicts: python-pbr < 5.8.1 |
140ca651 ER |
97 | |
98 | %description -n python3-pbr | |
d89984a8 JB |
99 | PBR is a library that injects some useful and sensible default |
100 | behaviors into your setuptools run. It started off life as the chunks | |
101 | of code that were copied between all of the OpenStack projects. Around | |
102 | the time that OpenStack hit 18 different projects each with at least 3 | |
103 | active branches, it seems like a good time to make that code into a | |
104 | proper re-usable library. | |
105 | ||
106 | %description -n python3-pbr -l pl.UTF-8 | |
107 | PBR to biblioteka wstrzykująca trochę przydatnych i sensownych | |
108 | domyślnych zachowań przy uruchomieniu setuptools. Początki wywodzą się | |
109 | z fragmentów kodu kopiowanych między wszystkimi projektami OpenStacka. | |
110 | Kiedy OpenStack dorobił się 18 różnych projektów, z których każdy miał | |
111 | przynajmniej 3 aktywne gałęzie, uznano to za dobry moment na | |
112 | wydzielenie kodu do biblioteki. | |
140ca651 | 113 | |
a62517a0 JB |
114 | %package doc |
115 | Summary: Documentation for Python pbr package | |
116 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona pbr | |
117 | Group: Documentation | |
118 | ||
119 | %description doc | |
120 | Documentation for Python pbr package (both user and API | |
121 | documentation). | |
122 | ||
123 | %description doc -l pl.UTF-8 | |
124 | Dokumentacja do pakietu Pythona pbr (zarówno dokumentacja użytkownika, | |
125 | jak i API). | |
126 | ||
140ca651 ER |
127 | %prep |
128 | %setup -q -n %{module}-%{version} | |
129 | ||
6255cbf2 | 130 | # Move away the requirements file so that pbr hooks don't add it |
d89984a8 | 131 | # to distutils requires_dist config |
6255cbf2 | 132 | %{__mv} test-requirements.txt{,.disabled} |
140ca651 ER |
133 | |
134 | # Remove bundled egg-info | |
d89984a8 | 135 | %{__rm} -r %{module}.egg-info |
140ca651 ER |
136 | |
137 | %build | |
138 | %if %{with python2} | |
2560be07 | 139 | %py_build %{?with_tests:test} |
9f4131a8 JB |
140 | |
141 | %{?with_tests:%{__rm} -r .testrepository} | |
140ca651 ER |
142 | %endif |
143 | ||
144 | %if %{with python3} | |
2560be07 | 145 | %py3_build %{?with_tests:test} |
9f4131a8 JB |
146 | |
147 | %{?with_tests:%{__rm} -r .testrepository} | |
140ca651 ER |
148 | %endif |
149 | ||
d89984a8 | 150 | %if %{with doc} |
140ca651 | 151 | # generate html docs |
9264f4e6 | 152 | sphinx-build-3 doc/source html |
140ca651 | 153 | # remove the sphinx-build leftovers |
d89984a8 JB |
154 | %{__rm} -r html/{_sources,.doctrees,.buildinfo} |
155 | %endif | |
140ca651 ER |
156 | |
157 | %install | |
158 | rm -rf $RPM_BUILD_ROOT | |
9264f4e6 | 159 | |
140ca651 | 160 | %if %{with python2} |
2560be07 | 161 | %py_install |
140ca651 ER |
162 | |
163 | %py_postclean | |
d89984a8 | 164 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pbr{,-2} |
140ca651 ER |
165 | %endif |
166 | ||
167 | %if %{with python3} | |
2560be07 | 168 | %py3_install |
d89984a8 | 169 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pbr{,-3} |
140ca651 ER |
170 | %endif |
171 | ||
9f4131a8 | 172 | %if %{with python2} |
d89984a8 | 173 | ln -sf pbr-2 $RPM_BUILD_ROOT%{_bindir}/pbr |
9f4131a8 | 174 | %endif |
d89984a8 | 175 | |
140ca651 ER |
176 | %clean |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
179 | %if %{with python2} | |
180 | %files | |
181 | %defattr(644,root,root,755) | |
5b8de432 | 182 | %doc AUTHORS ChangeLog LICENSE README.rst |
d89984a8 | 183 | %attr(755,root,root) %{_bindir}/pbr-2 |
140ca651 ER |
184 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
185 | %{py_sitescriptdir}/%{module} | |
186 | %endif | |
187 | ||
188 | %if %{with python3} | |
189 | %files -n python3-pbr | |
190 | %defattr(644,root,root,755) | |
5b8de432 JB |
191 | %doc AUTHORS ChangeLog LICENSE README.rst |
192 | %attr(755,root,root) %{_bindir}/pbr | |
d89984a8 | 193 | %attr(755,root,root) %{_bindir}/pbr-3 |
140ca651 ER |
194 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
195 | %{py3_sitescriptdir}/%{module} | |
196 | %endif | |
a62517a0 JB |
197 | |
198 | %if %{with doc} | |
199 | %files doc | |
200 | %defattr(644,root,root,755) | |
201 | %doc html/* | |
202 | %endif |