diff --git a/python-os-win.spec b/python-os-win.spec index 361321a..3df31ab 100644 --- a/python-os-win.spec +++ b/python-os-win.spec @@ -2,13 +2,17 @@ %global pypi_name os-win %global pyname os_win -%if 0%{?fedora} -%global with_python3 1 +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_with python2 +%bcond_without python3 +%else +%bcond_without python2 +%bcond_with python3 %endif Name: python-%{pypi_name} Version: 2.2.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Windows / Hyper-V library for OpenStack projects License: ASL 2.0 @@ -21,6 +25,7 @@ This library contains Windows / Hyper-V code commonly used in the OpenStack projects: nova, cinder, networking-hyperv. The library can be used in any other OpenStack projects where it is needed. +%if %{with python2} %package -n python2-%{pypi_name} Summary: Windows / Hyper-V library for OpenStack projects %{?python_provide:%python_provide python2-%{pypi_name}} @@ -57,8 +62,9 @@ Requires: python2-oslo-i18n >= 2.1.0 This library contains Windows / Hyper-V code commonly used in the OpenStack projects: nova, cinder, networking-hyperv. The library can be used in any other OpenStack projects where it is needed. +%endif -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{pypi_name} Summary: Windows / Hyper-V library for OpenStack projects %{?python_provide:%python_provide python3-%{pypi_name}} @@ -111,8 +117,10 @@ Documentation for the Windows / Hyper-V library for OpenStack projects rm -rf *requirements.txt %build +%if %{with python2} %py2_build -%if 0%{?with_python3} +%endif +%if %{with python3} %py3_build %endif @@ -122,25 +130,30 @@ sphinx-build doc/source html rm -rf html/.{doctrees,buildinfo} %install +%if %{with python2} %py2_install -%if 0%{?with_python3} +%endif +%if %{with python3} %py3_install %endif %check -%if 0%{?with_python3} +%if %{with python3} PYTHON=%{__python3} %{__python3} setup.py test rm -rf .testrepository %endif +%if %{with python2} PYTHON=%{__python2} %{__python2} setup.py test +%endif - +%if %{with python2} %files -n python2-%{pypi_name} %doc doc/source/readme.rst README.rst %license LICENSE %{python2_sitelib}/%{pyname}* +%endif -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{pypi_name} %license LICENSE %doc doc/source/readme.rst README.rst @@ -152,6 +165,9 @@ PYTHON=%{__python2} %{__python2} setup.py test %license LICENSE %changelog +* Tue Oct 16 2018 Javier Peña - 2.2.0-7 +- Remove the python2 package for Fedora 30+ (bz#1636937) + * Sat Jul 14 2018 Fedora Release Engineering - 2.2.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild