File python-openstackclient.spec of Package python-openstackclient

#
# spec file for package python-openstackclient
#
# 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/
#


Name:           python-openstackclient
Version:        3.14.0
Release:        0
Summary:        OpenStack Command-line Client
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            https://launchpad.net/python-openstackclient
Source0:        https://files.pythonhosted.org/packages/source/p/python-openstackclient/python-openstackclient-3.14.0.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python-devel
BuildRequires:  python2-cinderclient >= 3.3.0
BuildRequires:  python2-cliff >= 2.8.0
BuildRequires:  python2-fixtures >= 3.0.0
BuildRequires:  python2-glanceclient >= 2.8.0
BuildRequires:  python2-keystoneclient >= 3.8.0
BuildRequires:  python2-mock >= 2.0.0
BuildRequires:  python2-novaclient >= 9.1.0
BuildRequires:  python2-openstacksdk >= 0.9.19
BuildRequires:  python2-os-client-config >= 1.28.0
BuildRequires:  python2-os-testr >= 1.0.0
BuildRequires:  python2-osc-lib >= 1.8.0
BuildRequires:  python2-oslotest >= 3.2.0
BuildRequires:  python2-osprofiler >= 1.4.0
BuildRequires:  python2-requests >= 2.14.2
BuildRequires:  python2-requests-mock >= 1.1.0
BuildRequires:  python2-stevedore >= 1.20.0
BuildRequires:  python2-testrepository >= 0.0.18
BuildRequires:  python2-testtools >= 2.2.0
BuildRequires:  python2-wrapt >= 1.7.0
BuildRequires:  python3-cinderclient >= 3.3.0
BuildRequires:  python3-cliff >= 2.8.0
BuildRequires:  python3-devel
BuildRequires:  python3-fixtures >= 3.0.0
BuildRequires:  python3-glanceclient >= 2.8.0
BuildRequires:  python3-keystoneclient >= 3.8.0
BuildRequires:  python3-mock >= 2.0.0
BuildRequires:  python3-novaclient >= 9.1.0
BuildRequires:  python3-openstacksdk >= 0.9.19
BuildRequires:  python3-os-client-config >= 1.28.0
BuildRequires:  python3-os-testr >= 1.0.0
BuildRequires:  python3-osc-lib >= 1.8.0
BuildRequires:  python3-oslotest >= 3.2.0
BuildRequires:  python3-osprofiler >= 1.4.0
BuildRequires:  python3-requests >= 2.14.2
BuildRequires:  python3-requests-mock >= 1.1.0
BuildRequires:  python3-stevedore >= 1.20.0
BuildRequires:  python3-testrepository >= 0.0.18
BuildRequires:  python3-testtools >= 2.2.0
BuildRequires:  python3-wrapt >= 1.7.0
Requires:       python-Babel >= 2.3.4
Requires:       python-cinderclient >= 3.3.0
Requires:       python-cliff >= 2.8.0
Requires:       python-glanceclient >= 2.8.0
Requires:       python-heatclient >= 1.10.0
Requires:       python-keystoneauth1 >= 3.3.0
Requires:       python-keystoneclient >= 3.8.0
Requires:       python-novaclient >= 9.1.0
Requires:       python-openstacksdk >= 0.9.19
Requires:       python-osc-lib >= 1.8.0
Requires:       python-oslo.i18n >= 3.15.3
Requires:       python-oslo.utils >= 3.33.0
Requires:       python-six >= 1.10.0
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
python-openstackclient is a unified command-line client for the OpenStack APIs.
It is a thin wrapper to the stock python-*client modules that implement the
actual REST API client actions.

%package -n python-openstackclient-doc
Summary:        Documentation for OpenStack Command-line Client
# Some clients are commented out, since they have not been built yet
# TODO(jpena): uncomment them to enable their sections in the documentation
Group:          Documentation/HTML
BuildRequires:  python-Sphinx
#BuildRequires:  python-aodhclient >= 0.9.0
#BuildRequires:  python-barbicanclient >= 4.0.0
#BuildRequires:  python-congressclient >= 1.9.0
#BuildRequires:  python-designateclient >= 2.7.0
#BuildRequires:  python-heatclient >= 1.10.0
#BuildRequires:  python-ironicclient >= 2.2.0
#BuildRequires:  python-mistralclient >= 3.1.0
#BuildRequires:  python-muranoclient >= 0.8.2
#BuildRequires:  python-neutronclient >= 6.3.0
BuildRequires:  python-openstackdocstheme >= 1.18.1
#BuildRequires:  python-ironic-inspector-client >= 1.5.0
#BuildRequires:  python-saharaclient >= 1.4.0
#BuildRequires:  python-zaqarclient >= 1.0.0

%description -n python-openstackclient-doc
python-openstackclient is a unified command-line client for the OpenStack APIs.
It is a thin wrapper to the stock python-*client modules that implement the
actual REST API client actions.
This package contains auto-generated documentation.

%prep
%autosetup -p1 -n python-openstackclient-3.14.0
%py_req_cleanup
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg

%build
%{python_build}

%{__python2} setup.py build_sphinx -b html
%{__python2} setup.py build_sphinx -b 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/openstack.1 %{buildroot}%{_mandir}/man1/openstack.1
%python_clone -a %{buildroot}%{_bindir}/openstack
%python_clone -a %{buildroot}%{_mandir}/man1/openstack.1

%post
%{python_install_alternative openstack openstack.1}

%postun
%python_uninstall_alternative openstack

%check
%{python_expand rm -rf .testrepository
$python setup.py testr
}

%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/openstackclient
%{python_sitelib}/*.egg-info
%python_alternative %{_bindir}/openstack
%python_alternative %{_mandir}/man1/openstack.1

%files -n python-openstackclient-doc
%license LICENSE
%doc doc/build/html

%changelog
openSUSE Build Service is sponsored by