]> git.pld-linux.org Git - packages/python-openstacksdk.git/blame - python-openstacksdk.spec
- release 5 (by relup.sh)
[packages/python-openstacksdk.git] / python-openstacksdk.spec
CommitLineData
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
8Summary: An SDK for building applications to work with OpenStack
9Name: python-openstacksdk
10Version: 0.9.17
e9d11427 11Release: 5
ca7b03a6
JK
12License: Apache
13Group: Libraries/Python
14Source0: https://files.pythonhosted.org/packages/source/o/openstacksdk/openstacksdk-%{version}.tar.gz
15# Source0-md5: 0cd20ab358fd7bc89b874525c58335e2
16URL: https://pypi.python.org/pypi/openstacksdk/0.9.17
17BuildRequires: rpm-pythonprov
18BuildRequires: rpmbuild(macros) >= 1.714
19%if %{with python2}
20BuildRequires: python-pbr >= 2.0.0
21BuildRequires: python-setuptools
22%endif
23%if %{with python3}
24BuildRequires: python3-pbr >= 2.0.0
25BuildRequires: python3-setuptools
26%endif
27Requires: python-deprecation >= 1.0
28Requires: python-jsonpatch >= 1.1
29Requires: python-keystoneauth1 >= 2.21.0
30Requires: python-pbr >= 2.0.0
31Requires: python-six >= 1.9.0
32Requires: python-stevedore >= 1.20.0
33Requires: python-os-client-config >= 1.27.0
34BuildArch: noarch
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37%description
38The python-openstacksdk is a collection of libraries for building
39applications to work with OpenStack clouds. The project aims to
40provide a consistent and complete set of interactions with OpenStack's
41many services, along with complete documentation, examples, and tools.
42
43%package -n python3-openstacksdk
44Summary: An SDK for building applications to work with OpenStack
45Group: Libraries/Python
46Requires: python3-deprecation >= 1.0
47Requires: python3-jsonpatch >= 1.1
48Requires: python3-keystoneauth1 >= 2.21.0
49Requires: python3-modules
50Requires: python3-pbr >= 2.0.0
51Requires: python3-six >= 1.9.0
52Requires: python3-stevedore >= 1.20.0
53Requires: python3-os-client-config >= 1.27.0
54
55%description -n python3-openstacksdk
56The python-openstacksdk is a collection of libraries for building
57applications to work with OpenStack clouds. The project aims to
58provide a consistent and complete set of interactions with OpenStack's
59many services, along with complete documentation, examples, and tools.
60
61%package apidocs
62Summary: API documentation for Python openstacksdk module
63Summary(pl.UTF-8): Dokumentacja API modułu Pythona openstacksdk
64Group: Documentation
65
66%description apidocs
67API documentation for Pythona openstacksdk module.
68
69%description apidocs -l pl.UTF-8
70Dokumentacja 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}
85cd doc
86%{__make} -j1 html
87rm -rf _build/html/_sources
88%endif
89
90%install
91rm -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}
111install -d $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version}
112cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version}
113find $RPM_BUILD_ROOT%{_examplesdir}/python-openstacksdk-%{version} -name '*.py' \
114 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
115%endif
116%if %{with python3}
117install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version}
118cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version}
119find $RPM_BUILD_ROOT%{_examplesdir}/python3-openstacksdk-%{version} -name '*.py' \
120 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
121%endif
122
123%clean
124rm -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
This page took 0.126576 seconds and 4 git commands to generate.