]> git.pld-linux.org Git - packages/python-pbr.git/blob - python-pbr.spec
BR: rpmbuild(macros) >= 1.710
[packages/python-pbr.git] / python-pbr.spec
1 #
2 # Conditional build:
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
7
8 %define         module  pbr
9 Summary:        Python Build Reasonableness
10 Name:           python-%{module}
11 Version:        0.10.0
12 Release:        2
13 License:        Apache v2.0
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
20 %if %{with doc}
21 BuildRequires:  sphinx-pdg
22 %endif
23 %if %{with python2}
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
28 %endif
29 %if %{with tests}
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
40 %endif
41 %if %{with python3}
42 BuildRequires:  python3-d2to1
43 BuildRequires:  python3-devel
44 %endif
45 Requires:       python-pip
46 BuildArch:      noarch
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
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.
56
57 %package -n python3-pbr
58 Summary:        Python Build Reasonableness
59 Group:          Libraries/Python
60
61 %description -n python3-pbr
62 Manage 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
69 rm -rf {test-,}requirements.txt
70
71 # Remove bundled egg-info
72 rm -rf %{module}.egg-info
73
74 %build
75 %if %{with python2}
76 %py_build %{?with_tests:test}
77 %endif
78
79 %if %{with python3}
80 %py3_build %{?with_tests:test}
81 %endif
82
83 %if %{with test}
84 %{__python} setup.py test
85 %endif
86
87 # generate html docs
88 sphinx-build doc/source html
89 # remove the sphinx-build leftovers
90 rm -rf html/.{doctrees,buildinfo}
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 %if %{with python2}
95 %py_install
96
97 %py_postclean
98 %endif
99
100 %if %{with python3}
101 %py3_install
102 %endif
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %files
109 %defattr(644,root,root,755)
110 %doc html README.rst LICENSE
111 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
112 %{py_sitescriptdir}/%{module}
113 %endif
114
115 %if %{with python3}
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}
121 %endif
This page took 0.080381 seconds and 3 git commands to generate.