File python-keystoneauth1.spec of Package python-keystoneauth1
%global pypi_name keystoneauth1
%bcond_with python2
%bcond_with python3
%bcond_with test
%global common_desc \
Keystoneauth provides a standard way to do authentication and service requests \
within the OpenStack ecosystem. It is designed for use in conjunction with \
the existing OpenStack clients and for simplifying the process of writing \
new clients.
Name: python-%{pypi_name}
Version: 4.2.0
Release: 1%{?dist}
Summary: Authentication Library for OpenStack Clients
License: Apache-2.0
URL: https://pypi.io/pypi/%{pypi_name}
Source0: https://tarballs.openstack.org/keystoneauth/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%if %{with python3}
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr >= 2.0.0
# test requres
%if %{with test}
BuildRequires: python3-betamax >= 0.7.0
BuildRequires: python3-fixtures >= 1.3.1
BuildRequires: python3-lxml
BuildRequires: python3-requests-mock >= 1.1
BuildRequires: python3-oslotest
BuildRequires: python3-oslo-utils
BuildRequires: python3-os-testr
BuildRequires: python3-oauthlib
BuildRequires: python3-PyYAML
%endif # with test
Requires: python3-iso8601 >= 0.1.11
Requires: python3-pbr >= 2.0.0
Requires: python3-requests >= 2.14.2
Requires: python3-six => 1.10.0
Requires: python3-stevedore >= 1.20.0
Requires: python3-os-service-types >= 1.2.0
%description -n python3-%{pypi_name}
%{common_desc}
%endif # python3
%prep
echo "%{suse_version}"
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%if %{with python3}
%py3_build
%endif # python3
# generate html docs
# PYTHONPATH=${PWD} sphinx-build-3 doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%if %{with python3}
%py3_install
%endif # python3
%check
%if %{with test}
%if %{with python3}
%{__python3} setup.py test
%endif # with python3
%endif # with test
%if %{with python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/*.egg-info
%endif
%changelog