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