Add bcond for python 2

This commit is contained in:
Lumir Balhar 2019-11-08 09:51:07 +01:00
parent 960a9c1ff7
commit 4585345dae
1 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,7 @@
%global modname lxml
%bcond_without python2
Name: python-%{modname}
Version: 4.4.1
Release: 2%{?dist}
@ -22,6 +24,7 @@ home page < or see our bug tracker at case you want to use the current ...
%description %{_description}
%if %{with python2}
%package -n python2-%{modname}
Summary: %{summary}
BuildRequires: python2-devel
@ -34,6 +37,7 @@ Suggests: python%{python2_version}dist(beautifulsoup4)
%description -n python2-%{modname} %{_description}
Python 2 version.
%endif
%package -n python3-%{modname}
Summary: %{summary}
@ -56,21 +60,29 @@ find -type f -name '*.c' -print -delete
%build
env WITH_CYTHON=true %py3_build
%if %{with python2}
%py2_build
%endif
%install
%if %{with python2}
%py2_install
%endif
%py3_install
%check
%if %{with python2}
%{__python2} setup.py test
%endif
%{__python3} setup.py test
%if %{with python2}
%files -n python2-%{modname}
%license doc/licenses/ZopePublicLicense.txt LICENSES.txt
%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt
%{python2_sitearch}/%{modname}/
%{python2_sitearch}/%{modname}-*.egg-info/
%endif
%files -n python3-%{modname}
%license doc/licenses/ZopePublicLicense.txt LICENSES.txt