{% set pypi_name = 'python-freezerclient' %} {% set upstream_version = upstream_version('1.6.0') %} {% set rpm_release = '1' %} {% set source = url_pypi() %} Name: {{ py2name() }} Version: {{ py2rpmversion() }} Release: {{ py2rpmrelease() }} Summary: Python API and CLI for OpenStack Freezer 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('fixtures', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('python-keystoneclient', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('mock', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslo.i18n', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslo.utils', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslotest', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('pbr', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('python-subunit', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('setuptools', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testrepository', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testtools', py_versions=['py2', 'py3']) }} Requires: {{ py2pkg('cliff') }} Requires: {{ py2pkg('python-keystoneclient') }} Requires: {{ py2pkg('oslo.config') }} Requires: {{ py2pkg('oslo.i18n') }} Requires: {{ py2pkg('oslo.log') }} Requires: {{ py2pkg('oslo.utils') }} Requires: {{ py2pkg('pbr') }} 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 Client library for Freezer built on the Freezer API. It provides a Python API (the freezerclient module) and a command-line tool (freezer). %package -n python-freezerclient-doc Summary: Documentation for OpenStack Freezer API client libary Group: Documentation/HTML BuildRequires: {{ py2pkg('Sphinx') }} BuildRequires: {{ py2pkg('openstackdocstheme') }} %description -n python-freezerclient-doc Client library for Freezer built on the Freezer API. It provides a Python API (the freezerclient module) and a command-line tool (freezer). This package contains the documentation. %prep %autosetup -p1 -n %{name}-%{version} %py_req_cleanup sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg %build %{python_build} # Build HTML docs and man page %{__python2} setup.py build_sphinx rm -rf html/.{doctrees,buildinfo} %install %{python_install} %python_clone -a %{buildroot}%{_bindir}/freezer %post %python_install_alternative freezer %postun %python_uninstall_alternative freezer %check %{python_expand rm -rf .testrepository $python setup.py testr } %files %{python_files} %doc README.rst %license LICENSE %{python_sitelib}/freezerclient %{python_sitelib}/*.egg-info %python_alternative %{_bindir}/freezer %files -n python-freezerclient-doc %doc doc/build/html %license LICENSE %changelog