From 2721f1d57d7bf18ecda20ff3bdc663d6f281b8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 7 Mar 2019 12:51:56 +0100 Subject: [PATCH] Disable Py2 subpackage on F>=31 --- python-productmd.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/python-productmd.spec b/python-productmd.spec index 12583f3..195464d 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,10 +1,15 @@ +%if 0%{?fedora} >= 31 +%bcond_with python2 +%else +%bcond_without python2 +%endif %bcond_without python3 %global srcname productmd Name: python-%{srcname} Version: 1.20 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library providing parsers for metadata related to OS installation License: LGPLv2+ @@ -19,6 +24,7 @@ and installation media. %description %_description +%if 0%{?with_python2} %package -n python2-%{srcname} Summary: %summary Obsoletes: productmd <= %{version}-%{release} @@ -36,6 +42,7 @@ Requires: python2-six %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %_description +%endif %if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{srcname} @@ -52,31 +59,39 @@ Requires: python%{python3_pkgversion}-six %setup -q -n %{srcname}-%{version} %build +%if 0%{?with_python2} %py2_build +%endif %if 0%{?with_python3} %py3_build %endif %install +%if 0%{?with_python2} %py2_install +%endif %if 0%{?with_python3} %py3_install %endif %check +%if 0%{?with_python2} %{__python2} ./setup.py test +%endif %if 0%{?with_python3} %{__python3} ./setup.py test %endif +%if 0%{?with_python2} %files -n python2-%{srcname} %license LICENSE %doc AUTHORS %{python2_sitelib}/productmd/ %{python2_sitelib}/productmd-%{version}-py?.?.egg-info +%endif %if 0%{?with_python3} %files -n python%{python3_pkgversion}-%{srcname} @@ -87,6 +102,9 @@ Requires: python%{python3_pkgversion}-six %endif %changelog +* Thu Mar 07 2019 Lubomír Sedlář - 1.20-2 +- Disable python 2 subpackage on F>=31 + * Tue Mar 05 2019 Lubomír Sedlář - 1.20-1 - Improve getting sync between image types and formats