File python-troveclient.spec of Package python-troveclient

#
# spec file for package python-troveclient
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%if 0%{?suse_version} >= 1500
%define pyth python3
%define py_sitelib %{python3_sitelib}
%define py_build %{py3_build}
%define py_install %{py3_install}
%else
%define pyth python
%define py_sitelib %{python2_sitelib}
%define py_build %{py2_build}
%define py_install %{py2_install}
%endif

Name:           %{pyth}-troveclient
Version:        2.5.0
Release:        0
Summary:        Client library for OpenStack DBaaS API
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            http://launchpad.net/%{name}
Source0:        https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildRequires:  %{pyth}-PrettyTable >= 0.7
BuildRequires:  %{pyth}-Sphinx
BuildRequires:  %{pyth}-devel
BuildRequires:  %{pyth}-httplib2 >= 0.7.5
BuildRequires:  %{pyth}-keystoneauth1 >= 2.10.0
BuildRequires:  %{pyth}-mistralclient >= 2.0.0
BuildRequires:  %{pyth}-mock >= 2.0
BuildRequires:  %{pyth}-oslo.utils >= 3.16.0
BuildRequires:  %{pyth}-oslosphinx >= 2.5.0
BuildRequires:  %{pyth}-pbr >= 1.6
BuildRequires:  %{pyth}-pycrypto >= 2.6
BuildRequires:  %{pyth}-requests >= 2.10.0
BuildRequires:  %{pyth}-requests-mock >= 1.0
BuildRequires:  %{pyth}-setuptools >= 16.0
BuildRequires:  %{pyth}-simplejson >= 2.2.0
BuildRequires:  %{pyth}-swiftclient >= 2.2.0
BuildRequires:  %{pyth}-testrepository >= 0.0.18
BuildRequires:  %{pyth}-testscenarios >= 0.4
BuildRequires:  %{pyth}-testtools >= 1.4.0
BuildRequires:  openstack-macros
Requires:       %{pyth}-Babel >= 2.3.4
Requires:       %{pyth}-PrettyTable >= 0.7
Requires:       %{pyth}-keystoneauth1 >= 2.10.0
Requires:       %{pyth}-mistralclient >= 2.0.0
Requires:       %{pyth}-oslo.i18n >= 2.1.0
Requires:       %{pyth}-oslo.utils >= 3.16.0
Requires:       %{pyth}-pbr >= 1.6
Requires:       %{pyth}-requests >= 2.10.0
Requires:       %{pyth}-setuptools >= 16.0
Requires:       %{pyth}-simplejson >= 2.2.0
Requires:       %{pyth}-six >= 1.9.0
Requires:       %{pyth}-swiftclient >= 2.2.0
BuildArch:      noarch

%description
This is a client for the Trove API. There's a Python API (the
troveclient module), and a command-line script (trove). Each
implements 100% (or less ;) ) of the Trove API.

%package doc
Summary:        Documentation for OpenStack DBaaS API.
Group:          Documentation
BuildRequires:  %{pyth}-Sphinx
BuildRequires:  %{pyth}-oslosphinx >= 2.5.0

%description doc
Documentation for the client library for interacting with Openstack
DBaaS API.

%prep
%setup -q -n %{name}-%{version}

%build
%py_build
# Generate html docs
%{pyth} setup.py build_sphinx
# Remove the Sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
%py_install

%check
PYTHONPATH=. %{pyth} setup.py testr

%files
%doc README.rst
%license LICENSE
%{py_sitelib}/python_troveclient-*.egg-info
%{py_sitelib}/troveclient
%{_bindir}/trove

%files doc
%doc doc/build/html
%license LICENSE

%changelog