%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global sname swiftclient
%global common_desc \
Client library and command line utility for interacting with Openstack \
Object Storage API.
Name: python-swiftclient
Version: 3.5.0
Release: 3%{?dist}
Summary: Client Library for OpenStack Object Storage API
License: ASL 2.0
URL: http://launchpad.net/python-swiftclient/
Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python3-%{sname}
Summary: Client Library for OpenStack Object Storage API
%{?python_provide:%python_provide python3-swiftclient}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
Requires: python3-requests
Requires: python3-six
Requires: python3-keystoneclient
Conflicts: python2-%{sname} < 3.5.0-2
%description -n python3-%{sname}
%{common_desc}
%package doc
Summary: Documentation for OpenStack Object Storage API Client
BuildRequires: python3-sphinx
BuildRequires: python3-oslo-sphinx
%description doc
Documentation for the client library for interacting with Openstack
Object Storage API.
%prep
%setup -q -n %{name}-%{upstream_version}
# Let RPM handle the dependencies
rm -rf {,test-}requirements.txt
%build
%py3_build
%install
%py3_install
# Delete tests
rm -fr %{buildroot}%{python3_sitelib}/swiftclient/tests
%{__python3} setup.py build_sphinx -b html
rm -rf doc/build/html/.{doctrees,buildinfo}
%{__python3} setup.py build_sphinx -b man
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
%files -n python3-%{sname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{sname}
%{python3_sitelib}/*.egg-info
%{_bindir}/swift
%{_mandir}/man1/*
%files doc
%doc doc/build/html
%license LICENSE
%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 09 2019 Miro HronĨok <mhroncok@redhat.com> - 3.5.0-2
- Subpackage python2-swiftclient has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Feb 10 2018 RDO <dev@lists.rdoproject.org> 3.5.0-1
- Update to 3.5.0