Add build-conditionals for python2/python3
This commit is contained in:
parent
a50349c35b
commit
d64a203223
|
@ -1,3 +1,6 @@
|
|||
%bcond_without python2
|
||||
%bcond_without python3
|
||||
|
||||
%global modname lxml
|
||||
|
||||
Name: python-%{modname}
|
||||
|
@ -22,6 +25,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
|
||||
|
@ -35,7 +39,9 @@ Recommends: python2-beautifulsoup4
|
|||
%description -n python2-%{modname} %{_description}
|
||||
|
||||
Python 2 version.
|
||||
%endif
|
||||
|
||||
%if %{with python3}
|
||||
%package -n python3-%{modname}
|
||||
Summary: %{summary}
|
||||
BuildRequires: python3-devel
|
||||
|
@ -49,36 +55,56 @@ Recommends: python3-beautifulsoup4
|
|||
%description -n python3-%{modname} %{_description}
|
||||
|
||||
Python 3 version.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version}
|
||||
|
||||
%build
|
||||
export WITH_CYTHON=true
|
||||
%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
|
||||
|
||||
%check
|
||||
%if %{with python2}
|
||||
%{__python2} setup.py test
|
||||
%endif
|
||||
%if %{with python3}
|
||||
%{__python3} setup.py test
|
||||
%endif
|
||||
|
||||
%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
|
||||
|
||||
%if %{with python3}
|
||||
%files -n python3-%{modname}
|
||||
%license doc/licenses/ZopePublicLicense.txt LICENSES.txt
|
||||
%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt
|
||||
%{python3_sitearch}/%{modname}/
|
||||
%{python3_sitearch}/%{modname}-*.egg-info/
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Oct 5 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-1
|
||||
- Add build-conditionals for python2/python3
|
||||
|
||||
* Thu Oct 05 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0.0-1
|
||||
- Update to 4.0.0
|
||||
|
||||
|
|
Loading…
Reference in New Issue