diff --git a/python-swiftclient-3.10.1.tar.gz b/python-swiftclient-3.10.1.tar.gz deleted file mode 100644 index 088508c727b0afdfdbb25888762a307dbc9cbc8d..0000000000000000000000000000000000000000 Binary files a/python-swiftclient-3.10.1.tar.gz and /dev/null differ diff --git a/python-swiftclient-3.6.1.tar.gz b/python-swiftclient-3.6.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..be6814a619282c7cb5e30e3ca82c1d38b341c23b Binary files /dev/null and b/python-swiftclient-3.6.1.tar.gz differ diff --git a/python-swiftclient.spec b/python-swiftclient.spec index 18a5057705fe976304bc313aad0321af1543197f..8b3d155fd08b40a896a3055b0ef994bc7fc24113 100644 --- a/python-swiftclient.spec +++ b/python-swiftclient.spec @@ -1,76 +1,135 @@ -Name: python-swiftclient -Version: 3.10.1 -Release: 0 -Summary: OpenStack Object Storage API Client Library -License: Apache-2.0 -Group: Development/Languages/Python -URL: https://launchpad.net/python-swiftclient -Source0: https://files.pythonhosted.org/packages/source/p/python-swiftclient/python-swiftclient-3.10.1.tar.gz -BuildRequires: openstack-macros -BuildRequires: python3-keystoneclient -BuildRequires: python3-mock -BuildRequires: python3-pbr -BuildRequires: python3-stestr -BuildRequires: python3-testscenarios -BuildArch: noarch +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} + +%global sname swiftclient + +%global with_python3 0 + +%global common_desc \ +Client library and command line utility for interacting with Openstack \ +Object Storage API. + +Name: python-swiftclient +Version: 3.6.1 +Release: 1 +Summary: Client Library for OpenStack Object Storage API +License: Apache-2.0 +URL: http://launchpad.net/python-swiftclient/ +Source0: https://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz + +BuildArch: noarch %description -This is a python client for the Swift API. There's a Python API (the -swiftclient module), and a command-line script (swift). - -%package -n python3-swiftclient -Summary: OpenStack Object Storage API Client Library -Requires: python3-requests -Requires: python3-six -%if 0%{?suse_version} -Obsoletes: python2-swiftclient < 3.9.0 -%endif +%{common_desc} + +%package -n python2-%{sname} +Summary: Client Library for OpenStack Object Storage API +%{?python_provide:%python_provide python2-swiftclient} -%description -n python3-swiftclient -This is a python client for the Swift API. There's a Python API (the -swiftclient module), and a command-line script (swift). +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-pbr -This package contains the Python 3.x module. +Requires: python2-requests +Requires: python2-six +Requires: python2-keystoneclient +Requires: python2-futures -%package -n python-swiftclient-doc -Summary: %{summary} - Documentation -Group: Documentation/HTML -BuildRequires: python3-sphinx -BuildRequires: python3-openstackdocstheme +%description -n python2-%{sname} +%{common_desc} -%description -n python-swiftclient-doc -This is a python client for the Swift API. There's a Python API (the -swiftclient module), and a command-line script (swift). +%if 0%{?with_python3} +%package -n python3-%{sname} +Summary: Client Library for OpenStack Object Storage API +%{?python_provide:%python_provide python3-swiftclient} -This package contains documentation files for %{name}. +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pbr + +Requires: python3-requests +Requires: python3-six +Requires: python3-keystoneclient + +%description -n python3-%{sname} +%{common_desc} +%endif + +%package doc +Summary: Documentation for OpenStack Object Storage API Client +Group: Documentation + +BuildRequires: python2-sphinx +# (TODO) remove oslo-sphinx as BR after a new release is created +# including https://review.openstack.org/#/c/553433/. +# BuildRequires: python2-oslo-sphinx +BuildRequires: python2-openstackdocstheme +BuildRequires: openstack-macros +BuildRequires: python2-futures + +%description doc +Documentation for the client library for interacting with Openstack +Object Storage API. %prep -%autosetup -p1 -n python-swiftclient-3.10.1 +%setup -q -n %{name}-%{upstream_version} + +# Let RPM handle the dependencies %py_req_cleanup %build -%{py3_build} -PYTHONPATH=$PWD PBR_VERSION=%{version} sphinx-build-3 --keep-going -b html doc/source doc/build/html -rm -rf doc/build/html/.{doctrees,buildinfo} +%py2_build +%if 0%{?with_python3} +%py3_build +%endif %install -%{py3_install} +%if 0%{?with_python3} +%py3_install +mv %{buildroot}%{_bindir}/swift %{buildroot}%{_bindir}/swift-%{python3_version} +ln -s ./swift-%{python3_version} %{buildroot}%{_bindir}/swift-3 +# Delete tests +rm -fr %{buildroot}%{python3_sitelib}/swiftclient/tests +%endif + +%py2_install +mv %{buildroot}%{_bindir}/swift %{buildroot}%{_bindir}/swift-%{python2_version} +ln -s ./swift-%{python2_version} %{buildroot}%{_bindir}/swift-2 -%check -python3 -m stestr.cli run +ln -s ./swift-2 %{buildroot}%{_bindir}/swift + +# Delete tests +rm -fr %{buildroot}%{python2_sitelib}/swiftclient/tests + +%{__python2} setup.py build_sphinx -b html +rm -rf doc/build/html/.{doctrees,buildinfo} -%files -n python3-swiftclient +%{__python2} setup.py build_sphinx -b man +install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/ + +%files -n python2-%{sname} +%doc README.rst %license LICENSE -%doc ChangeLog README.rst -%{python3_sitelib}/swiftclient -%{python3_sitelib}/*.egg-info +%{python2_sitelib}/swiftclient +%{python2_sitelib}/*.egg-info %{_bindir}/swift -%{_mandir}/man1/swift.1* +%{_bindir}/swift-2 +%{_bindir}/swift-%{python2_version} +%{_mandir}/man1/* -%files -n python-swiftclient-doc +%if 0%{?with_python3} +%files -n python3-%{sname} %license LICENSE +%doc README.rst +%{python3_sitelib}/%{sname} +%{python3_sitelib}/*.egg-info +%{_bindir}/swift-3 +%{_bindir}/swift-%{python3_version} +%endif + +%files doc %doc doc/build/html +%license LICENSE %changelog -* Sat Jan 30 2021 liusheng - 3.10.1-1 -- Initial package of python-swiftclient +* Mon May 10 2021 Python_Bot +- Package Spec generated