]>
Commit | Line | Data |
---|---|---|
140ca651 ER |
1 | # |
2 | # Conditional build: | |
9f4131a8 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # test target | |
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 | |
11 | %endif | |
140ca651 ER |
12 | %define module pbr |
13 | Summary: Python Build Reasonableness | |
d89984a8 | 14 | Summary(pl.UTF-8): Python Build Reasonableness - rozsądne budowanie modułów pythonowych |
140ca651 | 15 | Name: python-%{module} |
d89984a8 | 16 | Version: 1.8.1 |
866add32 | 17 | Release: 2 |
140ca651 ER |
18 | License: Apache v2.0 |
19 | Group: Libraries/Python | |
d89984a8 JB |
20 | #Source0Download: https://pypi.python.org/pypi/pbr |
21 | Source0: https://pypi.python.org/packages/source/p/pbr/%{module}-%{version}.tar.gz | |
22 | # Source0-md5: c8f9285e1a4ca6f9654c529b158baa3a | |
23 | URL: https://launchpad.net/pbr | |
140ca651 | 24 | BuildRequires: rpm-pythonprov |
d89984a8 | 25 | BuildRequires: rpmbuild(macros) >= 1.714 |
8de31e80 ER |
26 | %if %{with doc} |
27 | BuildRequires: sphinx-pdg | |
28 | %endif | |
140ca651 ER |
29 | %if %{with python2} |
30 | # very new required, when also using tests | |
31 | BuildRequires: python-Sphinx >= 1.1.3 | |
d89984a8 | 32 | BuildRequires: python-devel >= 1:2.6 |
140ca651 | 33 | %if %{with tests} |
d89984a8 | 34 | # some still not packaged yet: |
140ca651 ER |
35 | BuildRequires: python-coverage >= 3.6 |
36 | BuildRequires: python-discover | |
d89984a8 JB |
37 | BuildRequires: python-fixtures >= 1.3.1 |
38 | BuildRequires: python-hacking >= 0.10.0 | |
39 | BuildRequires: python-hacking < 0.11 | |
40 | BuildRequires: python-mock >= 1.2 | |
41 | BuildRequires: python-six >= 1.9.0 | |
42 | BuildRequires: python-subunit >= 0.0.18 | |
140ca651 | 43 | BuildRequires: python-testrepository >= 0.0.18 |
d89984a8 JB |
44 | BuildRequires: python-testresources >= 0.2.4 |
45 | BuildRequires: python-testscenarios >= 0.4 | |
9f4131a8 | 46 | BuildRequires: python-testtools >= 1.1.0 |
d89984a8 | 47 | %endif |
140ca651 ER |
48 | %endif |
49 | %if %{with python3} | |
d89984a8 JB |
50 | BuildRequires: python3-devel >= 1:3.3 |
51 | %if %{with tests} | |
d89984a8 JB |
52 | BuildRequires: python3-fixtures >= 1.3.1 |
53 | BuildRequires: python3-hacking >= 0.10.0 | |
54 | BuildRequires: python3-hacking < 0.11 | |
d89984a8 JB |
55 | BuildRequires: python3-six >= 1.9.0 |
56 | BuildRequires: python3-subunit >= 0.0.18 | |
57 | BuildRequires: python3-testrepository >= 0.0.18 | |
58 | BuildRequires: python3-testresources >= 0.2.4 | |
59 | BuildRequires: python3-testscenarios >= 0.4 | |
9f4131a8 | 60 | BuildRequires: python3-testtools >= 1.1.0 |
d89984a8 | 61 | %endif |
140ca651 | 62 | %endif |
140ca651 ER |
63 | BuildArch: noarch |
64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
65 | ||
66 | %description | |
67 | PBR is a library that injects some useful and sensible default | |
68 | behaviors into your setuptools run. It started off life as the chunks | |
69 | of code that were copied between all of the OpenStack projects. Around | |
70 | the time that OpenStack hit 18 different projects each with at least 3 | |
71 | active branches, it seems like a good time to make that code into a | |
72 | proper re-usable library. | |
73 | ||
d89984a8 JB |
74 | %description -l pl.UTF-8 |
75 | PBR to biblioteka wstrzykująca trochę przydatnych i sensownych | |
76 | domyślnych zachowań przy uruchomieniu setuptools. Początki wywodzą się | |
77 | z fragmentów kodu kopiowanych między wszystkimi projektami OpenStacka. | |
78 | Kiedy OpenStack dorobił się 18 różnych projektów, z których każdy miał | |
79 | przynajmniej 3 aktywne gałęzie, uznano to za dobry moment na | |
80 | wydzielenie kodu do biblioteki. | |
81 | ||
140ca651 ER |
82 | %package -n python3-pbr |
83 | Summary: Python Build Reasonableness | |
d89984a8 | 84 | Summary(pl.UTF-8): Python Build Reasonableness - rozsądne budowanie modułów pythonowych |
140ca651 ER |
85 | Group: Libraries/Python |
86 | ||
87 | %description -n python3-pbr | |
d89984a8 JB |
88 | PBR is a library that injects some useful and sensible default |
89 | behaviors into your setuptools run. It started off life as the chunks | |
90 | of code that were copied between all of the OpenStack projects. Around | |
91 | the time that OpenStack hit 18 different projects each with at least 3 | |
92 | active branches, it seems like a good time to make that code into a | |
93 | proper re-usable library. | |
94 | ||
95 | %description -n python3-pbr -l pl.UTF-8 | |
96 | PBR to biblioteka wstrzykująca trochę przydatnych i sensownych | |
97 | domyślnych zachowań przy uruchomieniu setuptools. Początki wywodzą się | |
98 | z fragmentów kodu kopiowanych między wszystkimi projektami OpenStacka. | |
99 | Kiedy OpenStack dorobił się 18 różnych projektów, z których każdy miał | |
100 | przynajmniej 3 aktywne gałęzie, uznano to za dobry moment na | |
101 | wydzielenie kodu do biblioteki. | |
140ca651 ER |
102 | |
103 | %prep | |
104 | %setup -q -n %{module}-%{version} | |
105 | ||
106 | # Remove the requirements file so that pbr hooks don't add it | |
d89984a8 JB |
107 | # to distutils requires_dist config |
108 | %{__rm} test-requirements.txt | |
140ca651 ER |
109 | |
110 | # Remove bundled egg-info | |
d89984a8 | 111 | %{__rm} -r %{module}.egg-info |
140ca651 ER |
112 | |
113 | %build | |
114 | %if %{with python2} | |
2560be07 | 115 | %py_build %{?with_tests:test} |
9f4131a8 JB |
116 | |
117 | %{?with_tests:%{__rm} -r .testrepository} | |
140ca651 ER |
118 | %endif |
119 | ||
120 | %if %{with python3} | |
2560be07 | 121 | %py3_build %{?with_tests:test} |
9f4131a8 JB |
122 | |
123 | %{?with_tests:%{__rm} -r .testrepository} | |
140ca651 ER |
124 | %endif |
125 | ||
d89984a8 | 126 | %if %{with doc} |
140ca651 ER |
127 | # generate html docs |
128 | sphinx-build doc/source html | |
129 | # remove the sphinx-build leftovers | |
d89984a8 JB |
130 | %{__rm} -r html/{_sources,.doctrees,.buildinfo} |
131 | %endif | |
140ca651 ER |
132 | |
133 | %install | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | %if %{with python2} | |
2560be07 | 136 | %py_install |
140ca651 ER |
137 | |
138 | %py_postclean | |
d89984a8 | 139 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pbr{,-2} |
140ca651 ER |
140 | %endif |
141 | ||
142 | %if %{with python3} | |
2560be07 | 143 | %py3_install |
d89984a8 | 144 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pbr{,-3} |
140ca651 ER |
145 | %endif |
146 | ||
9f4131a8 | 147 | %if %{with python2} |
d89984a8 | 148 | ln -sf pbr-2 $RPM_BUILD_ROOT%{_bindir}/pbr |
9f4131a8 | 149 | %endif |
d89984a8 | 150 | |
140ca651 ER |
151 | %clean |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
154 | %if %{with python2} | |
155 | %files | |
156 | %defattr(644,root,root,755) | |
d89984a8 JB |
157 | %doc %{?with_doc:html} README.rst LICENSE |
158 | %attr(755,root,root) %{_bindir}/pbr | |
159 | %attr(755,root,root) %{_bindir}/pbr-2 | |
140ca651 ER |
160 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
161 | %{py_sitescriptdir}/%{module} | |
162 | %endif | |
163 | ||
164 | %if %{with python3} | |
165 | %files -n python3-pbr | |
166 | %defattr(644,root,root,755) | |
d89984a8 JB |
167 | %doc %{?with_doc:html} README.rst LICENSE |
168 | %attr(755,root,root) %{_bindir}/pbr-3 | |
140ca651 ER |
169 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
170 | %{py3_sitescriptdir}/%{module} | |
171 | %endif |