From 4c1750b994f54a862a37a937b0ef8ff50626625b Mon Sep 17 00:00:00 2001 From: Patrik Kopkan Date: Nov 12 2019 16:17:19 +0000 Subject: add %bcond python2 --- diff --git a/python-markupsafe.spec b/python-markupsafe.spec index 1c9aa87..2a64e5e 100644 --- a/python-markupsafe.spec +++ b/python-markupsafe.spec @@ -1,3 +1,5 @@ +%bcond_without python2 + Name: python-markupsafe Version: 1.1.1 Release: 4%{?dist} @@ -11,7 +13,7 @@ BuildRequires: gcc %description A library for safe markup escaping. - +%if %{with python2} %package -n python2-markupsafe Summary: Implements a XML/HTML/XHTML Markup safe string for Python 2 BuildRequires: python2-devel @@ -20,7 +22,7 @@ BuildRequires: python2dist(setuptools) %description -n python2-markupsafe A library for safe markup escaping. Python 2 version. - +%endif %package -n python3-markupsafe Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3 @@ -37,14 +39,18 @@ A library for safe markup escaping. Python 3 version. %build +%if %{with python2} %py2_build -%py3_build +%endif +%py3_build %install +%if %{with python2} %py2_install # C code errantly gets installed rm %{buildroot}%{python2_sitearch}/markupsafe/*.c +%endif %py3_install # C code errantly gets installed @@ -52,16 +58,19 @@ rm %{buildroot}%{python3_sitearch}/markupsafe/*.c %check +%if %{with python2} %{__python2} setup.py test +%endif %{__python3} setup.py test +%if %{with python2} %files -n python2-markupsafe %license LICENSE.rst %doc CHANGES.rst README.rst %{python2_sitearch}/MarkupSafe-%{version}-py%{python2_version}.egg-info/ %{python2_sitearch}/markupsafe/ - +%endif %files -n python3-markupsafe %license LICENSE.rst