From e8da257d014128b2bf11840f5e1ec382e6c52260 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Thu, 30 Aug 2018 12:43:18 +0200 Subject: [PATCH] Do not build python2 version for Fedora 30+ --- python-distro.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/python-distro.spec b/python-distro.spec index 57ab400..d736e75 100644 --- a/python-distro.spec +++ b/python-distro.spec @@ -4,10 +4,15 @@ %else %bcond_without python3 %endif +%if 0%{?fedora} > 29 +%bcond_with python2 +%else +%bcond_without python2 +%endif Name: python-%{pypi_name} Version: 1.3.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Linux Distribution - a Linux OS platform information API License: ASL 2.0 @@ -31,6 +36,7 @@ for more information. %description %{_description} +%if %{with python2} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} @@ -49,6 +55,7 @@ Suggests: /usr/bin/lsb_release %description -n python2-%{pypi_name} %{_description} Python 2 version. +%endif %if %{with python3} %package -n python3-%{pypi_name} @@ -72,22 +79,28 @@ Python 3 version. rm -rf %{pypi_name}.egg-info %build +%if %{with python2} %py2_build +%endif %if %{with python3} %py3_build %endif %install +%if %{with python2} %py2_install +%endif %if %{with python3} %py3_install %endif +%if %{with python2} %files -n python2-%{pypi_name} %doc README.rst CHANGELOG.md CONTRIBUTORS.md README.md %license LICENSE %{python2_sitelib}/%{pypi_name}-*.egg-info/ %{python2_sitelib}/%{pypi_name}.py* +%endif %if %{with python3} %files -n python3-%{pypi_name} @@ -101,12 +114,17 @@ rm -rf %{pypi_name}.egg-info %{_bindir}/distro %check +%if %{with python2} %{__python2} -m pytest tests -v +%endif %if %{with python3} %{__python3} -m pytest tests -v %endif %changelog +* Thu Aug 30 2018 Marek Blaha - 1.3.0-5 +- do not build python2 version for Fedora 30+ + * Sat Jul 14 2018 Fedora Release Engineering - 1.3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild