From e9176300c5d3b6333e16d74cf869caf25341fb73 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Jul 31 2016 21:20:44 +0000 Subject: Added py2 and py3 subpackage - Removed incomplete test subpackage Change-Id: Ibab022078968796d67577ea29b5d20923d9a5cab Co-Authored-By: Haikel Guémar (cherry picked from commit 09b3e5347c35c2b8a8194c3724e4353d8f11f522) (cherry picked from commit 17d0e4af9f2e814439627466a346b00046dc3944) --- diff --git a/python-designateclient.spec b/python-designateclient.spec index ceeb398..97346c9 100644 --- a/python-designateclient.spec +++ b/python-designateclient.spec @@ -1,82 +1,163 @@ %{!?upstream_version: %global upstream_version %{version}%{?milestone}} -%global service designate %global common_desc Client library and command line utility for interacting with Openstack Designate API -Name: python-%{service}client +%global sname designateclient + +%if 0%{?fedora} +%global with_python3 1 +%endif + +Name: python-%{sname} Version: 2.0.0 Release: 2%{?dist} Summary: Python API and CLI for OpenStack Designate License: ASL 2.0 -URL: http://launchpad.net/python-%{service}client/ -Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}%{?milestone}.tar.gz +URL: https://launchpad.net/python-%{sname}/ +Source0: https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch +%description +Client library and command line utility for interacting with Openstack Designate API + +%package -n python2-%{sname} +Summary: Python API and CLI for OpenStack Designate +%{?python_provide:%python_provide python2-%{sname}} + BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pbr -BuildRequires: python-d2to1 -# TODO: Delorean does not provide proper version yet Requires: python-cliff -#Requires: python-cliff >= 1.10.0 Requires: python-jsonschema >= 2.0.0 Requires: python-pbr -Requires: python-keystoneclient >= 1.1.0 +Requires: python-keystoneauth1 Requires: python-requests >= 2.2.0 Requires: python-six >= 1.9.0 -# TODO: Delorean does not provide proper version yet Requires: python-stevedore -#Requires: python-stevedore >= 1.3.0 +Requires: python-debtcollector +Requires: python-oslo-utils - -%description +%description -n python2-%{sname} %{common_desc} -%package tests -Summary: Designate client tests +%package -n python2-%{sname}-tests +Summary: Python API and CLI for OpenStack Designate (tests) +%{?python_provide:%python_provide python2-%{sname}-tests} Requires: %{name} = %{version}-%{release} +%description -n python2-%{sname}-tests +%{common_desc} + +This package contains Designate client tests files. -%description tests + +%if 0%{?with_python3} +%package -n python3-%{sname} +Summary: Python API and CLI for OpenStack Designate +%{?python_provide:%python_provide python3-%{sname}} + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pbr + +Requires: python3-cliff +Requires: python3-jsonschema >= 2.0.0 +Requires: python3-pbr +Requires: python3-keystoneauth1 +Requires: python3-requests >= 2.2.0 +Requires: python3-six >= 1.9.0 +Requires: python3-stevedore +Requires: python3-debtcollector +Requires: python3-oslo-utils + +%description -n python3-%{sname} %{common_desc} -This package contains Designate client test files. +%package -n python3-%{sname}-tests +Summary: Python API and CLI for OpenStack Designate (tests) +%{?python_provide:%python_provide python3-%{sname}-tests} +Requires: %{name} = %{version}-%{release} + +%description -n python3-%{sname}-tests +%{common_desc} + +This package contains Designate client tests files. +%endif + + +%package doc +Summary: Documentation for OpenStack Designate API Client + +BuildRequires: python-sphinx +BuildRequires: python-oslo-sphinx + +%description doc +%{common_desc} + +This package contains auto-generated documentation. %prep %setup -q -n %{name}-%{upstream_version} +rm -rf {,test-}requirements.txt %build -export PBR_VERSION=%{version} -export SKIP_PIP_INSTALL=1 -%{__python2} setup.py build +%py2_build +%if 0%{?with_python3} +%py3_build +%endif +%install +%if 0%{?with_python3} +%py3_install +mv %{buildroot}%{_bindir}/designate %{buildroot}%{_bindir}/designate-%{python3_version} +ln -s ./designate-%{python3_version} %{buildroot}%{_bindir}/designate-3 +%endif -%check -# TODO: add unit test run as a build step +%py2_install +mv %{buildroot}%{_bindir}/designate %{buildroot}%{_bindir}/designate-%{python2_version} +ln -s ./designate-%{python2_version} %{buildroot}%{_bindir}/designate-2 +ln -s ./designate-2 %{buildroot}%{_bindir}/designate -%install -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +export PYTHONPATH="$( pwd ):$PYTHONPATH" +sphinx-build -b html doc/source html -%files +%files -n python2-%{sname} +%doc README.rst +%license LICENSE +%{python2_sitelib}/designateclient +%exclude %{python2_sitelib}/%{sname}/tests +%{python2_sitelib}/*.egg-info +%{_bindir}/designate +%{_bindir}/designate-2 +%{_bindir}/designate-%{python2_version} + +%files -n python2-%{sname}-tests +%{python2_sitelib}/%{sname}/tests + +%if 0%{?with_python3} +%files -n python3-%{sname} %license LICENSE %doc README.rst -%{_bindir}/%{service} -%{python2_sitelib}/%{service}client -%{python2_sitelib}/python_%{service}client-*.egg-info -%exclude %{python2_sitelib}/%{service}client/tests - - -%files tests +%{python3_sitelib}/%{sname} +%exclude %{python3_sitelib}/%{sname}/tests +%{python3_sitelib}/*.egg-info +%{_bindir}/designate-3 +%{_bindir}/designate-%{python3_version} + +%files -n python3-%{sname}-tests +%{python3_sitelib}/%{sname}/tests +%endif + +%files doc +%doc html %license LICENSE -%{python2_sitelib}/%{service}client/tests - %changelog * Tue Jul 19 2016 Fedora Release Engineering - 2.0.0-2