From 19e68a90697942b3d89c098e24563a866e85edb3 Mon Sep 17 00:00:00 2001 From: Patrik Kopkan Date: Apr 14 2020 10:18:47 +0000 Subject: Add %bcond python2 --- diff --git a/python-markupsafe.spec b/python-markupsafe.spec index 9882ebe..a7422c8 100644 --- a/python-markupsafe.spec +++ b/python-markupsafe.spec @@ -1,3 +1,5 @@ +%bcond_without python2 + Name: python-markupsafe Version: 1.1.1 Release: 5%{?dist} @@ -12,6 +14,7 @@ BuildRequires: gcc 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,6 +23,7 @@ BuildRequires: python2dist(setuptools) %description -n python2-markupsafe A library for safe markup escaping. Python 2 version. +%endif %package -n python3-markupsafe @@ -37,14 +41,19 @@ A library for safe markup escaping. Python 3 version. %build +%if %{with python2} %py2_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,15 +61,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