%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.3 Release: 1%{?dist} Summary: General purpose template engine Group: Development/Languages License: BSD 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 Requires: python-babel >= 0.8 %if 0%{?with_python3} BuildRequires: python3-devel Requires: python3-babel >= 0.8 %endif # with_python3 %if 0%{?fedora} < 13 BuildRequires: python-setuptools-devel %endif %description 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. %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 %if 0%{?with_python3} pushd %{py3dir} CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py --with-speedups build popd %endif # with_python3 %install rm -rf %{buildroot} %{__python} setup.py --with-speedups install -O1 --skip-build \ --root %{buildroot} # ensure correct permission 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 # remove hidden file rm -rf docs/_build/html/.buildinfo # we can't use %doc to copy files (yet, see bz 563622) mkdir -p %{buildroot}/%{_datadir}/python3-jinja2-%{version} for f in AUTHORS CHANGES LICENSE docs/_build/html ext ; do cp -a "$f" %{buildroot}/%{_datadir}/python3-jinja2-%{version} done popd %endif # with_python3 %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc AUTHORS CHANGES LICENSE %doc ext %doc docs/_build/html %{python_sitearch}/* %if 0%{?with_python3} %files -n python3-jinja2 %defattr(-,root,root,-) %doc %{_datadir}/python3-jinja2-%{version} %{python3_sitearch}/* %endif # with_python3 %changelog * Sat Feb 10 2010 Thomas Moschny - 2.3-1 - Update to version 2.3. - Create python3 subpackage. * Sat Sep 19 2009 Thomas Moschny - 2.2.1-1 - Update to 2.2.1, mainly a bugfix release. - Remove patch no longer needed. - Remove conditional for FC-8. - Compilation of speedup module has to be explicitly requested now. * Sun Jul 26 2009 Fedora Release Engineering - 2.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 2.1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Jan 10 2009 Thomas Moschny - 2.1.1-1 - Update to 2.1.1 (bugfix release). * Thu Dec 18 2008 Thomas Moschny - 2.1-1 - Update to 2.1, which fixes a number of bugs. See http://jinja.pocoo.org/2/documentation/changelog#version-2-1. * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.0-3 - Rebuild for Python 2.6 * Tue Jul 22 2008 Thomas Moschny - 2.0-2 - Use rpm buildroot macro instead of RPM_BUILD_ROOT. * Sun Jul 20 2008 Thomas Moschny - 2.0-1 - Upstream released 2.0. * Sun Jun 29 2008 Thomas Moschny - 2.0-0.1.rc1 - Modified specfile from the existing python-jinja package.