]> git.pld-linux.org Git - packages/python-pbr.git/blame - python-pbr.spec
doc br
[packages/python-pbr.git] / python-pbr.spec
CommitLineData
140ca651
ER
1#
2# Conditional build:
8de31e80 3%bcond_without doc # don't build doc
140ca651
ER
4%bcond_with tests # tests are failing currently
5%bcond_without python2 # CPython 2.x module
6%bcond_with python3 # CPython 3.x module
7
8%define module pbr
9Summary: Python Build Reasonableness
10Name: python-%{module}
11Version: 0.10.0
12Release: 1
13License: Apache v2.0
14Group: Libraries/Python
15Source0: http://pypi.python.org/packages/source/p/%{module}/%{module}-%{version}.tar.gz
16# Source0-md5: 9e02dbfb5e49210c381fd4eea00cf7b7
17URL: http://pypi.python.org/pypi/pbr
18BuildRequires: rpmbuild(macros) >= 1.219
19BuildRequires: rpm-pythonprov
8de31e80
ER
20%if %{with doc}
21BuildRequires: sphinx-pdg
22%endif
140ca651
ER
23%if %{with python2}
24# very new required, when also using tests
25BuildRequires: python-Sphinx >= 1.1.3
26BuildRequires: python-d2to1 >= 0.2.10
27BuildRequires: python-devel
28%endif
29%if %{with tests}
30BuildRequires: python-testscenarios
31BuildRequires: python-testtools
32# still not packaged yet:
33BuildRequires: python-coverage >= 3.6
34BuildRequires: python-discover
35BuildRequires: python-flake8
36BuildRequires: python-mock >= 1.0
37BuildRequires: python-subunit
38BuildRequires: python-testrepository >= 0.0.18
39BuildRequires: python-testresources
40%endif
41%if %{with python3}
42BuildRequires: python3-d2to1
43BuildRequires: python3-devel
44%endif
45Requires: python-pip
46BuildArch: noarch
47BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49%description
50PBR is a library that injects some useful and sensible default
51behaviors into your setuptools run. It started off life as the chunks
52of code that were copied between all of the OpenStack projects. Around
53the time that OpenStack hit 18 different projects each with at least 3
54active branches, it seems like a good time to make that code into a
55proper re-usable library.
56
57%package -n python3-pbr
58Summary: Python Build Reasonableness
59Group: Libraries/Python
60
61%description -n python3-pbr
62Manage dynamic plugins for Python applications
63
64%prep
65%setup -q -n %{module}-%{version}
66
67# Remove the requirements file so that pbr hooks don't add it
68# to distutils requiers_dist config
69rm -rf {test-,}requirements.txt
70
71# Remove bundled egg-info
72rm -rf %{module}.egg-info
73
74%build
75%if %{with python2}
76%{__python} setup.py build --build-base build-2 %{?with_tests:test}
77%endif
78
79%if %{with python3}
80%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
81%endif
82
83%if %{with test}
84%{__python} setup.py test
85%endif
86
87# generate html docs
88sphinx-build doc/source html
89# remove the sphinx-build leftovers
90rm -rf html/.{doctrees,buildinfo}
91
92%install
93rm -rf $RPM_BUILD_ROOT
94%if %{with python2}
95%{__python} setup.py \
96 build --build-base build-2 \
97 install --skip-build \
98 --optimize=2 \
99 --root=$RPM_BUILD_ROOT
100
101%py_postclean
102%endif
103
104%if %{with python3}
105%{__python3} setup.py \
106 build --build-base build-3 \
107 install --skip-build \
108 --optimize=2 \
109 --root=$RPM_BUILD_ROOT
110%endif
111
112%clean
113rm -rf $RPM_BUILD_ROOT
114
115%if %{with python2}
116%files
117%defattr(644,root,root,755)
118%doc html README.rst LICENSE
119%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
120%{py_sitescriptdir}/%{module}
121%endif
122
123%if %{with python3}
124%files -n python3-pbr
125%defattr(644,root,root,755)
126%doc html README.rst LICENSE
127%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
128%{py3_sitescriptdir}/%{module}
129%endif
This page took 0.043081 seconds and 4 git commands to generate.