{% set pypi_name = 'oslo.i18n' %} {% set upstream_version = upstream_version('3.19.0') %} {% set rpm_release = '1' %} {% set source = url_pypi() %} Name: {{ py2name() }} Version: {{ py2rpmversion() }} Release: {{ py2rpmrelease() }} Summary: OpenStack i18n library License: {{ license('Apache-2.0') }} Group: Development/Languages/Python URL: https://launchpad.net/{{ pypi_name }} Source0: {{ source }} BuildRequires: openstack-macros BuildRequires: {{ py2pkg('Babel', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('mock', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslotest', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('pbr', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('testscenarios', py_versions=['py2', 'py3']) }} Requires: {{ py2pkg('Babel') }} Requires: {{ py2pkg('six') }} BuildArch: noarch %python_subpackages %description The oslo.i18n library contain utilities for working with internationalization (i18n) features, especially translation for text strings in an application or library. %package -n python-oslo.i18n-doc Summary: Documentation for OpenStack i18n library BuildRequires: {{ py2pkg('Sphinx') }} BuildRequires: {{ py2pkg('openstackdocstheme') }} %description -n python-oslo.i18n-doc Documentation for the oslo.i18n library. %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} %install %{python_install} # generate html docs %{__python2} setup.py build_sphinx # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %check %{python_expand rm -rf .testrepository $python setup.py test } %files %{python_files} %license LICENSE %{python_sitelib}/oslo_i18n %{python_sitelib}/*egg-info %files -n python-oslo.i18n-doc %doc doc/build/html ChangeLog CONTRIBUTING.rst README.rst %license LICENSE %changelog