diff --git a/python-osc-lib.spec b/python-osc-lib.spec index 7646950..2f4d270 100644 --- a/python-osc-lib.spec +++ b/python-osc-lib.spec @@ -1,12 +1,13 @@ %{!?upstream_version: %global upstream_version %{version}%{?milestone}} -# Python3 support in OpenStack starts with version 3.5, -# which is only in Fedora 24+ -%if 0%{?fedora} >= 24 -%global with_python3 1 +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_with python2 +%bcond_without python3 +%else +%bcond_without python2 +%bcond_with python3 %endif - %global library osc-lib %global module osc_lib @@ -14,7 +15,7 @@ Name: python-%{library} Version: 1.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OpenStack library for writing OSC plugins License: ASL 2.0 URL: https://github.com/openstack/%{library}/ @@ -23,6 +24,7 @@ Source0: https://tarballs.openstack.org/%{library}/%{library}-%{upstream_vers BuildArch: noarch +%if %{with python2} %package -n python2-%{library} Summary: OpenStack library for writing OSC plugins %{?python_provide:%python_provide python2-%{library}} @@ -73,6 +75,7 @@ Requires: python-cliff >= 2.8.0 Requires: python-simplejson >= 3.5.1 %endif + %description -n python2-%{library} %{common_desc} @@ -98,20 +101,25 @@ Requires: python-testrepository %{common_desc} This package contains the osc-lib library test files. - +%endif %package -n python-%{library}-doc Summary: OpenStack osc-lib library documentation +%if %{with python2} BuildRequires: python2-sphinx BuildRequires: python2-openstackdocstheme +%else +BuildRequires: python3-sphinx +BuildRequires: python3-openstackdocstheme +%endif %description -n python-%{library}-doc %{common_desc} This package contains the documentation. -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{library} Summary: OpenStack Example library %{?python_provide:%python_provide python3-%{library}} @@ -188,30 +196,37 @@ This package contains the osc-lib library test files. rm -f *requirements.txt %build +%if %{with python2} %py2_build -%if 0%{?with_python3} +%endif +%if %{with python3} %py3_build %endif # generate html docs -%{__python2} setup.py build_sphinx -b html +sphinx-build doc/source doc/build/html -b html # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install +%if %{with python2} %py2_install -%if 0%{?with_python3} +%endif +%if %{with python3} %py3_install %endif %check -# python setup.py test explicitly calls python versionless -%if 0%{?with_python3} -# %{__python3} setup.py test +# FIXME(jpena): unit tests are failing currently +%if %{with python3} +PYTHON=%{__python3} %{__python3} setup.py test || true rm -rf .testrepository %endif -# %{__python2} setup.py test +%if %{with python2} +PYTHON=%{__python2} %{__python2} setup.py test || true +%endif +%if %{with python2} %files -n python2-%{library} %license LICENSE %{python2_sitelib}/%{module} @@ -221,12 +236,13 @@ rm -rf .testrepository %files -n python2-%{library}-tests %license LICENSE %{python2_sitelib}/%{module}/tests +%endif %files -n python-%{library}-doc %license LICENSE %doc doc/build/html README.rst -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{library} %license LICENSE %{python3_sitelib}/%{module} @@ -239,6 +255,9 @@ rm -rf .testrepository %endif # with_python3 %changelog +* Fri Nov 30 2018 Javier Peña - 1.9.0-4 +- Remove the python2 package for Fedora 30+ (bz#1653080) + * Sat Jul 14 2018 Fedora Release Engineering - 1.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild