Don't build the Python 2 subpackage on EL > 7

This commit is contained in:
Charalampos Stratakis 2018-04-16 12:32:01 +02:00
parent e1414d036a
commit 4320e1dd94

View File

@ -1,20 +1,26 @@
Name: python-jinja2
Version: 2.10
Release: 2%{?dist}
Release: 3%{?dist}
Summary: General purpose template engine
Group: Development/Languages
License: BSD
URL: http://jinja.pocoo.org/
Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz
%bcond_without python2
%if 0%{?fedora} || 0%{?rhel} > 7
# Enable python3 build by default
%bcond_without python3
%else
%bcond_with python3
%endif
%if 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
# Enable building without docs to avoid a circular dependency between this
# and python-sphinx:
%bcond_without docs
@ -106,9 +112,10 @@ find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete
# fix EOL
sed -i 's|\r$||g' Jinja2-%{version}/LICENSE
mv Jinja2-%{version} python2
cp -av python2 python3
mv Jinja2-%{version} python3
%if %{with python2}
cp -av python3 python2
%endif # with python2
%build
%if %{with python2}
@ -121,7 +128,7 @@ make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2
popd
%endif # with python2
%if 0%{?with_python3}
%if %{?with_python3}
pushd python3
%py3_build
%if %{with docs}
@ -208,6 +215,9 @@ popd
%changelog
* Mon Apr 16 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.10-3
- Don't build the Python 2 subpackage on EL > 7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild