|
@@ -1,13 +1,15 @@
|
|
|
-%global with_python3 0
|
|
|
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
-
|
|
|
+# async support is valid only on Python >= 3.6
|
|
|
+%bcond_with async
|
|
|
# Enable building without docs to avoid a circular dependency between this
|
|
|
# and python-sphinx:
|
|
|
-%global with_docs 0
|
|
|
+%bcond_with docs
|
|
|
+
|
|
|
+%global with_python3 1
|
|
|
+
|
|
|
|
|
|
Name: python-jinja2
|
|
|
-Version: 2.5.5
|
|
|
-Release: 3%{?_dist_release}
|
|
|
+Version: 2.10
|
|
|
+Release: 1%{?_dist_release}
|
|
|
Summary: General purpose template engine
|
|
|
Group: Development/Languages
|
|
|
License: BSD
|
|
@@ -16,15 +18,17 @@ Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.g
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
|
BuildArch: noarch
|
|
|
BuildRequires: python-devel
|
|
|
+BuildRequires: python-rpm-macros
|
|
|
BuildRequires: python-setuptools
|
|
|
BuildRequires: python-markupsafe
|
|
|
-%if 0%{?with_docs}
|
|
|
+%if %{with docs}
|
|
|
BuildRequires: python-sphinx
|
|
|
-%endif # with_docs
|
|
|
+%endif # with docs
|
|
|
Requires: python-babel >= 0.8
|
|
|
Requires: python-markupsafe
|
|
|
%if 0%{?with_python3}
|
|
|
BuildRequires: python3-devel
|
|
|
+BuildRequires: python3-rpm-macros
|
|
|
BuildRequires: python3-setuptools
|
|
|
BuildRequires: python3-markupsafe
|
|
|
Requires: python3-markupsafe
|
|
@@ -69,93 +73,99 @@ environments.
|
|
|
|
|
|
|
|
|
%prep
|
|
|
-%setup -q -n Jinja2-%{version}
|
|
|
-
|
|
|
+%setup -qc -n Jinja2-%{version}
|
|
|
# cleanup
|
|
|
-find . -name '*.pyo' -o -name '*.pyc' -delete
|
|
|
+find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete
|
|
|
|
|
|
# fix EOL
|
|
|
-%__sed -i 's|\r$||g' LICENSE
|
|
|
-
|
|
|
-%if 0%{?with_python3}
|
|
|
-%__cp -a . %{py3dir}
|
|
|
-%endif # with_python3
|
|
|
+sed -i 's|\r$||g' Jinja2-%{version}/LICENSE
|
|
|
|
|
|
+mv Jinja2-%{version} python3
|
|
|
+cp -av python3 python2
|
|
|
|
|
|
%build
|
|
|
-%{__python} setup.py build
|
|
|
-
|
|
|
-# for now, we build docs using Python 2.x and use that for both
|
|
|
-# packages.
|
|
|
-%if 0%{?with_docs}
|
|
|
-%__make -C docs html
|
|
|
-%endif # with_docs
|
|
|
+pushd python2
|
|
|
+%py_build
|
|
|
+%if %{with docs}
|
|
|
+make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-2
|
|
|
+%endif # with docs
|
|
|
+popd
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
-pushd %{py3dir}
|
|
|
-%{__python3} setup.py build
|
|
|
+pushd python3
|
|
|
+%py3_build
|
|
|
+%if %{with docs}
|
|
|
+make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3
|
|
|
+%endif # with docs
|
|
|
popd
|
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
%install
|
|
|
%__rm -rf %{buildroot}
|
|
|
-%{__python} setup.py install -O1 --skip-build \
|
|
|
- --root %{buildroot}
|
|
|
+pushd python2
|
|
|
+%py_install
|
|
|
|
|
|
# remove hidden file
|
|
|
-%__rm -rf docs/_build/html/.buildinfo
|
|
|
+rm -rf docs/_build/html/.buildinfo
|
|
|
|
|
|
-%if 0%{?with_python3}
|
|
|
-pushd %{py3dir}
|
|
|
-%{__python3} setup.py install -O1 --skip-build \
|
|
|
- --root %{buildroot}
|
|
|
+# these files are valid only on Python 3.6+
|
|
|
+rm %{buildroot}%{python_sitelib}/jinja2/asyncsupport.py
|
|
|
+rm %{buildroot}%{python_sitelib}/jinja2/asyncfilters.py
|
|
|
popd
|
|
|
-%endif # with_python3
|
|
|
|
|
|
+%if %{with python3}
|
|
|
+pushd python3
|
|
|
+%py3_install
|
|
|
|
|
|
-%clean
|
|
|
-%__rm -rf %{buildroot}
|
|
|
-
|
|
|
-
|
|
|
-%check
|
|
|
-%__make test
|
|
|
-
|
|
|
+# remove hidden file
|
|
|
+rm -rf docs/_build/html/.buildinfo
|
|
|
|
|
|
-%if 0%{?with_python3}
|
|
|
-pushd %{py3dir}
|
|
|
-%__make test
|
|
|
+%if ! %{with async}
|
|
|
+# these files are valid only on Python 3.6+
|
|
|
+rm %{buildroot}%{python3_sitelib}/jinja2/asyncsupport.py
|
|
|
+rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py
|
|
|
+%endif # ! with async
|
|
|
popd
|
|
|
-%endif # with_python3
|
|
|
+%endif # with python3
|
|
|
|
|
|
+%clean
|
|
|
+%__rm -rf %{buildroot}
|
|
|
|
|
|
%files
|
|
|
%defattr(-,root,root,-)
|
|
|
-%doc AUTHORS CHANGES LICENSE
|
|
|
-%if 0%{?with_docs}
|
|
|
-%doc docs/_build/html
|
|
|
-%endif # with_docs
|
|
|
-%doc ext
|
|
|
-%doc examples
|
|
|
-%{python_sitelib}/*
|
|
|
-%exclude %{python_sitelib}/jinja2/_debugsupport.c
|
|
|
-
|
|
|
+%doc python2/AUTHORS
|
|
|
+%doc python2/CHANGES.rst
|
|
|
+%doc python2/ext
|
|
|
+%doc python2/examples
|
|
|
+%license python2/LICENSE
|
|
|
+%if %{with docs}
|
|
|
+%doc python2/docs/_build/html
|
|
|
+%endif
|
|
|
+%{python_sitelib}/jinja2
|
|
|
+%{python_sitelib}/Jinja2-%{version}-py*.egg-info
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
%files -n python3-jinja2
|
|
|
%defattr(-,root,root,-)
|
|
|
-%doc AUTHORS CHANGES LICENSE
|
|
|
-%if 0%{?with_docs}
|
|
|
-%doc docs/_build/html
|
|
|
-%endif # with_docs
|
|
|
-%doc ext
|
|
|
-%doc examples
|
|
|
-%{python3_sitelib}/*
|
|
|
-%exclude %{python3_sitelib}/jinja2/_debugsupport.c
|
|
|
+%doc python3/AUTHORS
|
|
|
+%doc python3/CHANGES.rst
|
|
|
+%doc python3/ext
|
|
|
+%doc python3/examples
|
|
|
+%license python2/LICENSE
|
|
|
+%if %{with docs}
|
|
|
+%doc python3/docs/_build/html
|
|
|
+%endif # with docs
|
|
|
+%{python3_sitelib}/jinja2
|
|
|
+%{python3_sitelib}/Jinja2-%{version}-py*.egg-info
|
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Tue Nov 27 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.10-1
|
|
|
+- new upstream release.
|
|
|
+- added python3 support.
|
|
|
+
|
|
|
* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.5.5-3
|
|
|
- rebuild with VineSeed environment
|
|
|
|