diff --git a/python-designateclient.spec b/python-designateclient.spec index 5a57554..d58e102 100644 --- a/python-designateclient.spec +++ b/python-designateclient.spec @@ -6,12 +6,16 @@ Client library and command line utility for interacting with Openstack Designate %global sname designateclient %if 0%{?fedora} -%global with_python3 1 +%bcond_with python2 +%bcond_without python3 +%else +%bcond_without python2 +%bcond_with python3 %endif Name: python-%{sname} Version: 2.9.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python API and CLI for OpenStack Designate License: ASL 2.0 @@ -25,6 +29,7 @@ BuildRequires: git %description %{common_desc} +%if %{with python2} %package -n python2-%{sname} Summary: Python API and CLI for OpenStack Designate %{?python_provide:%python_provide python2-%{sname}} @@ -62,12 +67,15 @@ Requires: python2-%{sname} = %{version}-%{release} %{common_desc} This package contains Designate client tests files. +%endif %if 0%{?with_python3} %package -n python3-%{sname} Summary: Python API and CLI for OpenStack Designate %{?python_provide:%python_provide python3-%{sname}} +# We need to Obsolete python2 to ensure upgrade path +Obsoletes: python2-%{sname} < %{version}-%{release} BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -103,6 +111,7 @@ This package contains Designate client tests files. %package doc Summary: Documentation for OpenStack Designate API Client +%if %{with python2} BuildRequires: python2-sphinx BuildRequires: python2-openstackdocstheme BuildRequires: python2-keystoneauth1 @@ -112,6 +121,13 @@ BuildRequires: python2-jsonschema %else BuildRequires: python-jsonschema %endif +%else +BuildRequires: python3-sphinx +BuildRequires: python3-openstackdocstheme +BuildRequires: python3-keystoneauth1 +BuildRequires: python3-osc-lib +BuildRequires: python3-jsonschema +%endif %description doc %{common_desc} @@ -124,7 +140,9 @@ This package contains auto-generated documentation. rm -rf {,test-}requirements.txt %build +%if %{with python2} %py2_build +%endif %if 0%{?with_python3} %py3_build %endif @@ -134,17 +152,22 @@ rm -rf {,test-}requirements.txt %py3_install mv %{buildroot}%{_bindir}/designate %{buildroot}%{_bindir}/designate-%{python3_version} ln -s ./designate-%{python3_version} %{buildroot}%{_bindir}/designate-3 +ln -s ./designate-3 %{buildroot}%{_bindir}/designate + +%{__python3} setup.py build_sphinx -b html %endif +%if %{with python2} %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 - %{__python2} setup.py build_sphinx -b html +%endif +%if %{with python2} %files -n python2-%{sname} %doc README.rst %license LICENSE @@ -157,6 +180,7 @@ ln -s ./designate-2 %{buildroot}%{_bindir}/designate %files -n python2-%{sname}-tests %{python2_sitelib}/%{sname}/tests +%endif %if 0%{?with_python3} %files -n python3-%{sname} @@ -165,6 +189,7 @@ ln -s ./designate-2 %{buildroot}%{_bindir}/designate %{python3_sitelib}/%{sname} %exclude %{python3_sitelib}/%{sname}/tests %{python3_sitelib}/*.egg-info +%{_bindir}/designate %{_bindir}/designate-3 %{_bindir}/designate-%{python3_version} @@ -177,6 +202,9 @@ ln -s ./designate-2 %{buildroot}%{_bindir}/designate %license LICENSE %changelog +* Mon Dec 03 2018 Alfredo Moralejo 2.9.0-2 +- Remove python2 subpackages. + * Sun Feb 11 2018 RDO 2.9.0-1 - Update to 2.9.0