]>
Commit | Line | Data |
---|---|---|
96a5e342 ER |
1 | # |
2 | # Conditional build: | |
ba176720 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_with tests # unit tests | |
96a5e342 | 5 | %bcond_without python2 # CPython 2.x module |
5c637730 | 6 | %bcond_without python3 # CPython 3.x module |
96a5e342 ER |
7 | |
8 | %define module stevedore | |
9 | Summary: Manage dynamic plugins for Python applications | |
ba176720 | 10 | Summary(pl.UTF-8): Zarządzanie dynamicznymi wtyczkami dla aplikacji Pythona |
96a5e342 | 11 | Name: python-%{module} |
ba176720 JB |
12 | # keep 1.x here for python2 support |
13 | Version: 1.32.0 | |
14 | Release: 1 | |
96a5e342 | 15 | License: Apache v2.0 |
ba176720 JB |
16 | Group: Libraries/Python |
17 | #Source0Download: https://pypi.org/simple/stevedore/ | |
18 | Source0: https://files.pythonhosted.org/packages/source/s/stevedore/stevedore-%{version}.tar.gz | |
19 | # Source0-md5: f854d6ed0f6fcaf93a32c755d706ce19 | |
20 | URL: https://pypi.org/project/stevedore/ | |
96a5e342 | 21 | BuildRequires: rpm-pythonprov |
ba176720 | 22 | BuildRequires: rpmbuild(macros) >= 1.714 |
96a5e342 | 23 | %if %{with python2} |
ba176720 | 24 | BuildRequires: python-modules >= 1:2.7 |
96a5e342 | 25 | BuildRequires: python-setuptools |
5c637730 | 26 | BuildRequires: python-pbr >= 2.0.0 |
96a5e342 | 27 | %if %{with tests} |
ba176720 JB |
28 | BuildRequires: python-coverage >= 4.0 |
29 | BuildRequires: python-six >= 1.10.0 | |
30 | BuildRequires: python-mock >= 2.0.0 | |
31 | BuildRequires: python-stestr >= 2.0.0 | |
32 | BuildRequires: sphinx-pdg-2 >= 1.7.0 | |
96a5e342 ER |
33 | %endif |
34 | %endif | |
35 | %if %{with python3} | |
96a5e342 | 36 | BuildRequires: python3-setuptools |
5c637730 JK |
37 | BuildRequires: python3-pbr >= 2.0.0 |
38 | %if %{with tests} | |
ba176720 JB |
39 | BuildRequires: python3-coverage >= 4.0 |
40 | BuildRequires: python3-six >= 1.10.0 | |
41 | #BuildRequires: python3-mock >= 2.0.0 | |
42 | BuildRequires: python3-stestr >= 2.0.0 | |
43 | BuildRequires: sphinx-pdg-3 >= 1.7.0 | |
5c637730 | 44 | %endif |
96a5e342 | 45 | %endif |
ba176720 JB |
46 | %if %{with doc} |
47 | BuildRequires: python-openstackdocstheme >= 1.11.0 | |
48 | BuildRequires: python-reno >= 2.5.0 | |
49 | BuildRequires: sphinx-pdg-2 >= 1.7.0 | |
50 | %endif | |
51 | Requires: python-modules >= 1:2.7 | |
96a5e342 ER |
52 | BuildArch: noarch |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
ba176720 JB |
56 | Manage dynamic plugins for Python applications. |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | Zarządzanie dynamicznymi wtyczkami dla aplikacji Pythona. | |
96a5e342 ER |
60 | |
61 | %package -n python3-stevedore | |
62 | Summary: Manage dynamic plugins for Python applications | |
ba176720 JB |
63 | Summary(pl.UTF-8): Zarządzanie dynamicznymi wtyczkami dla aplikacji Pythona |
64 | Group: Libraries/Python | |
65 | Requires: python3-modules >= 1:3.6 | |
96a5e342 ER |
66 | |
67 | %description -n python3-stevedore | |
68 | Manage dynamic plugins for Python applications | |
69 | ||
ba176720 JB |
70 | %description -n python3-stevedore -l pl.UTF-8 |
71 | Zarządzanie dynamicznymi wtyczkami dla aplikacji Pythona. | |
72 | ||
73 | %package apidocs | |
74 | Summary: API documentation for Python stevedore module | |
75 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona stevedore | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | API documentation for Python stevedore module. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja API modułu Pythona stevedore. | |
83 | ||
96a5e342 ER |
84 | %prep |
85 | %setup -q -n stevedore-%{version} | |
86 | ||
87 | %build | |
88 | %if %{with python2} | |
5c637730 | 89 | %py_build %{?with_tests:test} |
96a5e342 ER |
90 | %endif |
91 | ||
92 | %if %{with python3} | |
87ab386f | 93 | %py3_build %{?with_tests:test} |
96a5e342 ER |
94 | %endif |
95 | ||
ba176720 JB |
96 | %if %{with doc} |
97 | PYTHONPATH=$(pwd) \ | |
98 | %{__make} -C doc html \ | |
99 | SPHINXBUILD=sphinx-build-2 | |
100 | %endif | |
101 | ||
96a5e342 ER |
102 | %install |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with python2} | |
87ab386f | 106 | %py_install |
96a5e342 | 107 | |
2a313414 | 108 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/stevedore/tests |
c552d429 | 109 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/stevedore/example |
2a313414 | 110 | |
96a5e342 ER |
111 | %py_postclean |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
87ab386f | 115 | %py3_install |
2a313414 ER |
116 | |
117 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/stevedore/tests | |
c552d429 | 118 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/stevedore/example |
96a5e342 ER |
119 | %endif |
120 | ||
121 | %clean | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
124 | %if %{with python2} | |
125 | %files | |
126 | %defattr(644,root,root,755) | |
ba176720 | 127 | %doc AUTHORS ChangeLog README.rst announce.rst |
96a5e342 ER |
128 | %{py_sitescriptdir}/stevedore |
129 | %{py_sitescriptdir}/stevedore-%{version}-py*.egg-info | |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
133 | %files -n python3-stevedore | |
134 | %defattr(644,root,root,755) | |
ba176720 | 135 | %doc AUTHORS ChangeLog README.rst announce.rst |
96a5e342 ER |
136 | %{py3_sitescriptdir}/stevedore |
137 | %{py3_sitescriptdir}/stevedore-%{version}-py*.egg-info | |
138 | %endif | |
ba176720 JB |
139 | |
140 | %if %{with doc} | |
141 | %files apidocs | |
142 | %defattr(644,root,root,755) | |
143 | %doc doc/build/html/{_images,_static,install,reference,user,*.html,*.js} | |
144 | %endif |