3 %bcond_without doc # don't build doc
4 %bcond_with tests # tests are failing currently
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module
9 Summary: Python Build Reasonableness
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: http://pypi.python.org/packages/source/p/%{module}/%{module}-%{version}.tar.gz
16 # Source0-md5: 9e02dbfb5e49210c381fd4eea00cf7b7
17 URL: http://pypi.python.org/pypi/pbr
18 BuildRequires: rpmbuild(macros) >= 1.710
19 BuildRequires: rpm-pythonprov
21 BuildRequires: sphinx-pdg
24 # very new required, when also using tests
25 BuildRequires: python-Sphinx >= 1.1.3
26 BuildRequires: python-d2to1 >= 0.2.10
27 BuildRequires: python-devel
30 BuildRequires: python-testscenarios
31 BuildRequires: python-testtools
32 # still not packaged yet:
33 BuildRequires: python-coverage >= 3.6
34 BuildRequires: python-discover
35 BuildRequires: python-flake8
36 BuildRequires: python-mock >= 1.0
37 BuildRequires: python-subunit
38 BuildRequires: python-testrepository >= 0.0.18
39 BuildRequires: python-testresources
42 BuildRequires: python3-d2to1
43 BuildRequires: python3-devel
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 PBR is a library that injects some useful and sensible default
51 behaviors into your setuptools run. It started off life as the chunks
52 of code that were copied between all of the OpenStack projects. Around
53 the time that OpenStack hit 18 different projects each with at least 3
54 active branches, it seems like a good time to make that code into a
55 proper re-usable library.
57 %package -n python3-pbr
58 Summary: Python Build Reasonableness
59 Group: Libraries/Python
61 %description -n python3-pbr
62 Manage dynamic plugins for Python applications
65 %setup -q -n %{module}-%{version}
67 # Remove the requirements file so that pbr hooks don't add it
68 # to distutils requiers_dist config
69 rm -rf {test-,}requirements.txt
71 # Remove bundled egg-info
72 rm -rf %{module}.egg-info
76 %py_build %{?with_tests:test}
80 %py3_build %{?with_tests:test}
84 %{__python} setup.py test
88 sphinx-build doc/source html
89 # remove the sphinx-build leftovers
90 rm -rf html/.{doctrees,buildinfo}
93 rm -rf $RPM_BUILD_ROOT
105 rm -rf $RPM_BUILD_ROOT
109 %defattr(644,root,root,755)
110 %doc html README.rst LICENSE
111 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
112 %{py_sitescriptdir}/%{module}
116 %files -n python3-pbr
117 %defattr(644,root,root,755)
118 %doc html README.rst LICENSE
119 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
120 %{py3_sitescriptdir}/%{module}