%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname glanceclient
%global common_desc \
This is a client for the OpenStack Glance API. There's a Python API (the \
glanceclient module), and a command-line script (glance). Each implements \
100% of the OpenStack Glance API.
Name: python-glanceclient
Epoch: 1
Version: 2.10.0
Release: 2%{?dist}
Summary: Python API and CLI for OpenStack Glance
License: ASL 2.0
URL: https://launchpad.net/python-glanceclient
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
%description
%{common_desc}
%package -n python3-%{sname}
Summary: Python API and CLI for OpenStack Glance
%{?python_provide:%python_provide python3-glanceclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-keystoneauth1 >= 3.3.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-pyOpenSSL >= 16.2.0
Requires: python3-requests
Requires: python3-six >= 1.10.0
Requires: python3-warlock
Requires: python3-wrapt
%description -n python3-%{sname}
%{common_desc}
%package doc
Summary: Documentation for OpenStack Glance API Client
BuildRequires: python3-sphinx
BuildRequires: python3-openstackdocstheme
BuildRequires: python3-keystoneauth1
BuildRequires: python3-oslo-utils
BuildRequires: python3-prettytable
BuildRequires: python3-pyOpenSSL >= 16.2.0
BuildRequires: python3-warlock
%description doc
%{common_desc}
This package contains auto-generated documentation.
%prep
%autosetup -n %{name}-%{upstream_version} -S git
rm -rf {,test-}requirements.txt
%build
%py3_build
%install
%py3_install
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/glanceclient/tests
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
install -pm 644 tools/glance.bash_completion \
%{buildroot}%{_sysconfdir}/bash_completion.d/glance
# generate html docs
%{__python3} setup.py build_sphinx -b html
# generate man page
%{__python3} setup.py build_sphinx -b man
install -p -D -m 644 doc/build/man/glance.1 %{buildroot}%{_mandir}/man1/glance.1
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_sysconfdir}/bash_completion.d
%{_mandir}/man1/glance.1.gz
%{_bindir}/glance
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Wed Jan 31 2019 Yatin Karel <ykarel@redhat.com> 1:2.10.0-2
- Drop python2 sub package
* Wed Apr 18 2018 RDO <dev@lists.rdoproject.org> 1:2.10.0-1
- Update to 2.10.0
* Sat Feb 10 2018 RDO <dev@lists.rdoproject.org> 1:2.9.1-1
- Update to 2.9.1