{% set pypi_name = 'python-cinderclient' %} {% set upstream_version = upstream_version('3.5.0') %} {% set rpm_release = '1' %} {% set source = url_pypi() %} Name: {{ py2name() }} Version: {{ py2rpmversion() }} Release: {{ py2rpmrelease() }} Summary: Python API and CLI for OpenStack Cinder License: {{ license('Apache-2.0')}} Group: Development/Languages/Python URL: https://launchpad.net/{{ pypi_name }} Source0: {{ source }} BuildRequires: openstack-macros BuildRequires: {{ py2pkg('devel', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('PrettyTable', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('ddt', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('fixtures', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('keystoneauth1', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('mock', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('os-testr', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslo.serialization', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslo.utils', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('pbr', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('python-subunit', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('requests', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('requests-mock', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testrepository', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testscenarios', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testtools', py_versions=['py2', 'py3']) }} Requires: {{ py2pkg('Babel') }} Requires: {{ py2pkg('PrettyTable') }} Requires: {{ py2pkg('keystoneauth1') }} Requires: {{ py2pkg('oslo.i18n') }} Requires: {{ py2pkg('oslo.utils') }} Requires: {{ py2pkg('requests') }} Requires: {{ py2pkg('simplejson') }} Requires: {{ py2pkg('six') }} BuildArch: noarch %if 0%{?suse_version} Requires(post): update-alternatives Requires(postun): update-alternatives %else # on RDO, update-alternatives is in chkconfig Requires(post): chkconfig Requires(postun): chkconfig %endif %python_subpackages %description This is a client for the OpenStack Cinder API (Block Storage. There's a Python API (the cinderclient module), and a command-line script (cinder). Each implements 100% of the OpenStack Cinder API. %package -n python-cinderclient-doc Summary: Documentation for OpenStack Cinder API Client Group: Documentation/HTML BuildRequires: {{ py2pkg('Sphinx') }} BuildRequires: {{ py2pkg('openstackdocstheme') }} BuildRequires: {{ py2pkg('reno') }} %description -n python-cinderclient-doc This is a client for the OpenStack Cinder API (Block Storage. There's a Python API (the cinderclient module), and a command-line script (cinder). Each implements 100% of the OpenStack Cinder API. This package contains auto-generated documentation. %prep %autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }} %py_req_cleanup sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg %build %{python_build} %{__python2} setup.py build_sphinx --builder=html,man # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install %{python_install} # man page install -p -D -m 644 doc/build/man/cinder.1 %{buildroot}%{_mandir}/man1/cinder.1 # bash completion install -p -D -m 644 tools/cinder.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/cinder.bash_completion %python_clone -a %{buildroot}%{_bindir}/cinder %python_clone -a %{buildroot}%{_mandir}/man1/cinder.1 %python_clone -a %{buildroot}%{_sysconfdir}/bash_completion.d/cinder.bash_completion %post %{python_install_alternative cinder cinder.1 %{_sysconfdir}/bash_completion.d/cinder.bash_completion} %postun %python_uninstall_alternative cinder %check rm cinderclient/tests/unit/test_shell.py %{python_expand rm -rf .testrepository ostestr } %files %{python_files} %license LICENSE %doc README.rst ChangeLog %{python_sitelib}/cinderclient %{python_sitelib}/*.egg-info %python_alternative %{_bindir}/cinder %python_alternative %{_mandir}/man1/cinder.1 %python_alternative %{_sysconfdir}/bash_completion.d/cinder.bash_completion %files -n python-cinderclient-doc %license LICENSE %doc doc/build/html %changelog