From bb45b9d930692d355078f3922e898036ab801384 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Tue, 13 Jul 2010 22:21:52 +0000 Subject: [PATCH] - Update to upstream version 2.5. - Create python3 subpackage. --- .cvsignore | 2 +- import.log | 1 + python-jinja2.spec | 89 +++++++++++++++++++++++++++++++++++++++++++--- sources | 2 +- 4 files changed, 88 insertions(+), 6 deletions(-) diff --git a/.cvsignore b/.cvsignore index 7f62aca..d362e38 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -Jinja2-2.4.1.tar.gz +Jinja2-2.5.tar.gz diff --git a/import.log b/import.log index b91baf9..f58b034 100644 --- a/import.log +++ b/import.log @@ -5,3 +5,4 @@ python-jinja2-2_2_1-1_fc11:HEAD:python-jinja2-2.2.1-1.fc11.src.rpm:1253462191 python-jinja2-2_3_1-1_fc12:HEAD:python-jinja2-2.3.1-1.fc12.src.rpm:1266965250 python-jinja2-2_4-1_fc12:HEAD:python-jinja2-2.4-1.fc12.src.rpm:1271178578 python-jinja2-2_4_1-1_fc12:HEAD:python-jinja2-2.4.1-1.fc12.src.rpm:1271848385 +python-jinja2-2_5-1_fc13:HEAD:python-jinja2-2.5-1.fc13.src.rpm:1279059589 diff --git a/python-jinja2.spec b/python-jinja2.spec index 6268ef2..571e29e 100644 --- a/python-jinja2.spec +++ b/python-jinja2.spec @@ -1,7 +1,11 @@ -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%global with_python3 1 +%else +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%endif Name: python-jinja2 -Version: 2.4.1 +Version: 2.5 Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages @@ -10,9 +14,18 @@ URL: http://jinja.pocoo.org/ Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel -BuildRequires: python-setuptools-devel BuildRequires: python-sphinx Requires: python-babel >= 0.8 +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +# babel isn't py3k ready yet, and is only a weak dependency +#Requires: python3-babel >= 0.8 +%endif # with_python3 + +%if 0%{?fedora} < 13 +BuildRequires: python-setuptools-devel +%endif %description @@ -27,17 +40,49 @@ principles and adding functionality useful for templating environments. +%if 0%{?with_python3} +%package -n python3-jinja2 +Summary: General purpose template engine +Group: Development/Languages + + +%description -n python3-jinja2 +Jinja2 is a template engine written in pure Python. It provides a +Django inspired non-XML syntax but supports inline expressions and an +optional sandboxed environment. + +If you have any exposure to other text-based template languages, such +as Smarty or Django, you should feel right at home with Jinja2. It's +both designer and developer friendly by sticking to Python's +principles and adding functionality useful for templating +environments. +%endif # with_python3 + + %prep %setup -q -n Jinja2-%{version} # fix EOL sed -i 's|\r$||g' LICENSE +%if 0%{?with_python3} +cp -a . %{py3dir} +%endif # with_python3 + %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py --with-speedups build +CFLAGS="%{optflags}" %{__python} setup.py --with-speedups build + +# for now, we build docs using Python 2.x and use that for both +# packages. make -C docs html +%if 0%{?with_python3} +pushd %{py3dir} +CFLAGS="%{optflags}" %{__python3} setup.py --with-speedups build +popd +%endif # with_python3 + %install rm -rf %{buildroot} @@ -50,6 +95,15 @@ chmod 0755 %{buildroot}%{python_sitearch}/jinja2/_speedups.so # remove hidden file rm -rf docs/_build/html/.buildinfo +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py --with-speedups install -O1 --skip-build \ + --root %{buildroot} + +# ensure correct permission +chmod 0755 %{buildroot}%{python3_sitearch}/jinja2/_speedups.so +%endif # with_python3 + %clean rm -rf %{buildroot} @@ -59,16 +113,43 @@ rm -rf %{buildroot} make test +%if 0%{?with_python3} +pushd %{py3dir} +make test +popd +%endif # with_python3 + + %files %defattr(-,root,root,-) %doc AUTHORS CHANGES LICENSE %doc docs/_build/html %doc ext +%doc examples %{python_sitearch}/* %exclude %{python_sitearch}/jinja2/_speedups.c +%if 0%{?with_python3} +%files -n python3-jinja2 +%defattr(-,root,root,-) +%doc AUTHORS CHANGES LICENSE +%doc docs/_build/html +%doc ext +%doc examples +%{python3_sitearch}/* +%exclude %{python3_sitearch}/jinja2/_speedups.c +%endif # with_python3 + + %changelog +* Tue Jul 13 2010 Thomas Moschny - 2.5-1 +- Update to upstream version 2.5. +- Create python3 subpackage. +- Minor specfile fixes. +- Add examples directory. +- Thanks to Gareth Armstrong for additional hints. + * Wed Apr 21 2010 Thomas Moschny - 2.4.1-1 - Update to 2.4.1. diff --git a/sources b/sources index b544a9b..34d4778 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e0cf5af057fac63ac9689b86c8b31ce6 Jinja2-2.4.1.tar.gz +d02f82e33afe918cef8a9abcd23ccd78 Jinja2-2.5.tar.gz