File python-openstackclient.spec of Package python-openstackclient

# spec file for package python-openstackclient
# Copyright (c) 2020 SUSE LLC
# 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

Name:           python-openstackclient
Version:        3.16.3
Release:        0
Summary:        OpenStack Command-line Client
License:        Apache-2.0
Group:          Development/Languages/Python
Patch1:         0001-Add-dns-domain-support-to-Network.patch
Patch2:         0002-Fix-openstack-server-list-deleted-marker.patch
BuildRequires:  openstack-macros
BuildRequires:  python-devel
BuildRequires:  python2-cinderclient
BuildRequires:  python2-cliff
BuildRequires:  python2-fixtures
BuildRequires:  python2-glanceclient
BuildRequires:  python2-keystoneclient
BuildRequires:  python2-mock
BuildRequires:  python2-novaclient
BuildRequires:  python2-openstacksdk
BuildRequires:  python2-os-client-config
BuildRequires:  python2-os-testr
BuildRequires:  python2-osc-lib
BuildRequires:  python2-oslotest
BuildRequires:  python2-osprofiler
BuildRequires:  python2-requests
BuildRequires:  python2-requests-mock
BuildRequires:  python2-stevedore
BuildRequires:  python2-testrepository
BuildRequires:  python2-testtools
BuildRequires:  python2-wrapt
BuildRequires:  python3-cinderclient
BuildRequires:  python3-cliff
BuildRequires:  python3-devel
BuildRequires:  python3-fixtures
BuildRequires:  python3-glanceclient
BuildRequires:  python3-keystoneclient
BuildRequires:  python3-mock
BuildRequires:  python3-novaclient
BuildRequires:  python3-openstacksdk
BuildRequires:  python3-os-client-config
BuildRequires:  python3-os-testr
BuildRequires:  python3-osc-lib
BuildRequires:  python3-oslotest
BuildRequires:  python3-osprofiler
BuildRequires:  python3-requests
BuildRequires:  python3-requests-mock
BuildRequires:  python3-stevedore
BuildRequires:  python3-testrepository
BuildRequires:  python3-testtools
BuildRequires:  python3-wrapt
Requires:       python-Babel
Requires:       python-cinderclient
Requires:       python-cliff
Requires:       python-glanceclient
Requires:       python-heatclient
Requires:       python-keystoneauth1
Requires:       python-keystoneclient
Requires:       python-novaclient
Requires:       python-openstacksdk
Requires:       python-osc-lib
Requires:       python-oslo.i18n
Requires:       python-oslo.utils
Requires:       python-six
BuildArch:      noarch
%if 0%{?suse_version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
# on RDO, update-alternatives is in chkconfig
Requires(post): chkconfig
Requires(postun): chkconfig

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
#BuildRequires:  python-barbicanclient
#BuildRequires:  python-congressclient
#BuildRequires:  python-designateclient
#BuildRequires:  python-heatclient
#BuildRequires:  python-ironicclient
#BuildRequires:  python-mistralclient
#BuildRequires:  python-muranoclient
#BuildRequires:  python-neutronclient
BuildRequires:  python-openstackdocstheme
#BuildRequires:  python-ironic-inspector-client
#BuildRequires:  python-saharaclient
#BuildRequires:  python-zaqarclient
BuildRequires:  python-sphinxcontrib-apidoc

%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.

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


PBR_VERSION=3.16.3 sphinx-build -b html doc/source doc/build/html
PBR_VERSION=3.16.3 sphinx-build -b man doc/source doc/build/man
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

# 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

%{python_install_alternative openstack openstack.1}

%python_uninstall_alternative openstack

%{python_expand rm -rf .testrepository
$python testr

%files %{python_files}
%doc README.rst
%license LICENSE
%python_alternative %{_bindir}/openstack
%python_alternative %{_mandir}/man1/openstack.1

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

openSUSE Build Service is sponsored by