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
8 Summary: An SDK for building applications to work with OpenStack
9 Name: python-openstacksdk
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
20 BuildRequires: python-pbr >= 2.0.0
21 BuildRequires: python-setuptools
24 BuildRequires: python3-pbr >= 2.0.0
25 BuildRequires: python3-setuptools
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
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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
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.
62 Summary: API documentation for Python openstacksdk module
63 Summary(pl.UTF-8): Dokumentacja API modułu Pythona openstacksdk
67 API documentation for Pythona openstacksdk module.
69 %description apidocs -l pl.UTF-8
70 Dokumentacja API modułu Pythona openstacksdk.
73 %setup -q -n openstacksdk-%{version}
77 %py_build %{?with_tests:test}
81 %py3_build %{?with_tests:test}
87 rm -rf _build/html/_sources
91 rm -rf $RPM_BUILD_ROOT
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}
109 # in case there are examples provided
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}|'
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}|'
124 rm -rf $RPM_BUILD_ROOT
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}
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}
146 %defattr(644,root,root,755)
147 %doc doc/_build/html/*