]>
Commit | Line | Data |
---|---|---|
ca7b03a6 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # build doc (missing dep) | |
4 | %bcond_with tests # do perform "make test" (broken) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: An SDK for building applications to work with OpenStack | |
9 | Name: python-openstacksdk | |
10 | Version: 0.9.17 | |
e9d11427 | 11 | Release: 5 |
ca7b03a6 JK |
12 | License: Apache |
13 | Group: Libraries/Python | |
14 | Source0: https://files.pythonhosted.org/packages/source/o/openstacksdk/openstacksdk-%{version}.tar.gz | |
15 | # Source0-md5: 0cd20ab358fd7bc89b874525c58335e2 | |
16 | URL: https://pypi.python.org/pypi/openstacksdk/0.9.17 | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-pbr >= 2.0.0 | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-pbr >= 2.0.0 | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | Requires: python-deprecation >= 1.0 | |
28 | Requires: python-jsonpatch >= 1.1 | |
29 | Requires: python-keystoneauth1 >= 2.21.0 | |
30 | Requires: python-pbr >= 2.0.0 | |
31 | Requires: python-six >= 1.9.0 | |
32 | Requires: python-stevedore >= 1.20.0 | |
33 | Requires: python-os-client-config >= 1.27.0 | |
34 | BuildArch: noarch | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | The python-openstacksdk is a collection of libraries for building | |
39 | applications to work with OpenStack clouds. The project aims to | |
40 | provide a consistent and complete set of interactions with OpenStack's | |
41 | many services, along with complete documentation, examples, and tools. | |
42 | ||
43 | %package -n python3-openstacksdk | |
44 | Summary: An SDK for building applications to work with OpenStack | |
45 | Group: Libraries/Python | |
46 | Requires: python3-deprecation >= 1.0 | |
47 | Requires: python3-jsonpatch >= 1.1 | |
48 | Requires: python3-keystoneauth1 >= 2.21.0 | |
49 | Requires: python3-modules | |
50 | Requires: python3-pbr >= 2.0.0 | |
51 | Requires: python3-six >= 1.9.0 | |
52 | Requires: python3-stevedore >= 1.20.0 | |
53 | Requires: python3-os-client-config >= 1.27.0 | |
54 | ||
55 | %description -n python3-openstacksdk | |
56 | The python-openstacksdk is a collection of libraries for building | |
57 | applications to work with OpenStack clouds. The project aims to | |
58 | provide a consistent and complete set of interactions with OpenStack's | |
59 | many services, along with complete documentation, examples, and tools. | |
60 | ||
61 | %package apidocs | |
62 | Summary: API documentation for Python openstacksdk module | |
63 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona openstacksdk | |
64 | Group: Documentation | |
65 | ||
66 | %description apidocs | |
67 | API documentation for Pythona openstacksdk module. | |
68 | ||
69 | %description apidocs -l pl.UTF-8 | |
70 | Dokumentacja API modułu Pythona openstacksdk. | |
71 | ||
72 | %prep | |
73 | %setup -q -n openstacksdk-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with python2} | |
77 | %py_build %{?with_tests:test} | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | %py3_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with doc} | |
85 | cd doc | |
86 | %{__make} -j1 html | |
87 | rm -rf _build/html/_sources | |
88 | %endif | |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
93 | %if %{with python2} | |
94 | %py_install | |
95 | ||
96 | # when files are installed in other way that standard 'setup.py | |
97 | # they need to be (re-)compiled | |
98 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
99 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
100 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
101 | ||
102 | %py_postclean | |
103 | %endif | |
104 | ||
105 | %if %{with python3} | |
106 | %py3_install | |
107 | %endif | |
108 | ||
109 | # in case there are examples provided | |
110 | %if %{with python2} | |
111 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version} | |
112 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version} | |
113 | find $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version} -name '*.py' \ | |
114 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
115 | %endif | |
116 | %if %{with python3} | |
117 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version} | |
118 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version} | |
119 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version} -name '*.py' \ | |
120 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
121 | %endif | |
122 | ||
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %if %{with python2} | |
127 | %files | |
128 | %defattr(644,root,root,755) | |
129 | %doc AUTHORS ChangeLog README.rst | |
130 | %{py_sitescriptdir}/openstack | |
131 | %{py_sitescriptdir}/openstacksdk-%{version}-py*.egg-info | |
132 | %{_examplesdir}/python-openstacksdk-%{version} | |
133 | %endif | |
134 | ||
135 | %if %{with python3} | |
136 | %files -n python3-openstacksdk | |
137 | %defattr(644,root,root,755) | |
138 | %doc AUTHORS ChangeLog README.rst | |
139 | %{py3_sitescriptdir}/openstack | |
140 | %{py3_sitescriptdir}/openstacksdk-%{version}-py*.egg-info | |
141 | %{_examplesdir}/python3-openstacksdk-%{version} | |
142 | %endif | |
143 | ||
144 | %if %{with doc} | |
145 | %files apidocs | |
146 | %defattr(644,root,root,755) | |
147 | %doc doc/_build/html/* | |
148 | %endif |