56fc4d
%if 0%{?fedora} > 12
56fc4d
%global with_python3 1
56fc4d
%else
56fc4d
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
56fc4d
%endif
56fc4d
56fc4d
# Enable building without docs to avoid a circular dependency between this
56fc4d
# and python-sphinx:
56fc4d
%global with_docs 1
56fc4d
56fc4d
Name:		python-jinja2
56fc4d
Version:	2.6
56fc4d
Release:	6%{?dist}
56fc4d
Summary:	General purpose template engine
56fc4d
Group:		Development/Languages
56fc4d
License:	BSD
56fc4d
URL:		http://jinja.pocoo.org/
56fc4d
Source0:	http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz
56fc4d
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
56fc4d
BuildArch:	noarch
56fc4d
BuildRequires:	python-devel
56fc4d
BuildRequires:	python-setuptools
56fc4d
BuildRequires:	python-markupsafe
56fc4d
%if 0%{?with_docs}
56fc4d
BuildRequires:	python-sphinx
56fc4d
%endif # with_docs
56fc4d
Requires:	python-babel >= 0.8
56fc4d
Requires:	python-markupsafe
56fc4d
%if 0%{?with_python3}
56fc4d
BuildRequires:	python3-devel
56fc4d
BuildRequires:	python3-setuptools
56fc4d
BuildRequires:	python3-markupsafe
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%description
56fc4d
Jinja2 is a template engine written in pure Python.  It provides a
56fc4d
Django inspired non-XML syntax but supports inline expressions and an
56fc4d
optional sandboxed environment.
56fc4d
56fc4d
If you have any exposure to other text-based template languages, such
56fc4d
as Smarty or Django, you should feel right at home with Jinja2. It's
56fc4d
both designer and developer friendly by sticking to Python's
56fc4d
principles and adding functionality useful for templating
56fc4d
environments.
56fc4d
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
%package -n python3-jinja2
56fc4d
Summary:	General purpose template engine
56fc4d
Group:		Development/Languages
56fc4d
Requires:	python3-markupsafe
56fc4d
# babel isn't py3k ready yet, and is only a weak dependency
56fc4d
#Requires:	 python3-babel >= 0.8
56fc4d
56fc4d
56fc4d
%description -n python3-jinja2
56fc4d
Jinja2 is a template engine written in pure Python.  It provides a
56fc4d
Django inspired non-XML syntax but supports inline expressions and an
56fc4d
optional sandboxed environment.
56fc4d
56fc4d
If you have any exposure to other text-based template languages, such
56fc4d
as Smarty or Django, you should feel right at home with Jinja2. It's
56fc4d
both designer and developer friendly by sticking to Python's
56fc4d
principles and adding functionality useful for templating
56fc4d
environments.
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%prep
56fc4d
%setup -q -n Jinja2-%{version}
56fc4d
56fc4d
# cleanup
56fc4d
find . -name '*.pyo' -o -name '*.pyc' -delete
56fc4d
56fc4d
# fix EOL
56fc4d
sed -i 's|\r$||g' LICENSE
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
cp -a . %{py3dir}
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%build
56fc4d
%{__python} setup.py build
56fc4d
56fc4d
# for now, we build docs using Python 2.x and use that for both
56fc4d
# packages.
56fc4d
%if 0%{?with_docs}
56fc4d
make -C docs html
56fc4d
%endif # with_docs
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
pushd %{py3dir}
56fc4d
%{__python3} setup.py build
56fc4d
popd
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%install
56fc4d
rm -rf %{buildroot}
56fc4d
%{__python} setup.py install -O1 --skip-build \
56fc4d
	    --root %{buildroot}
56fc4d
56fc4d
# remove hidden file
56fc4d
rm -rf docs/_build/html/.buildinfo
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
pushd %{py3dir}
56fc4d
%{__python3} setup.py install -O1 --skip-build \
56fc4d
	    --root %{buildroot}
56fc4d
popd
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%clean
56fc4d
rm -rf %{buildroot}
56fc4d
56fc4d
56fc4d
%check
56fc4d
make test
56fc4d
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
pushd %{py3dir}
56fc4d
make test
56fc4d
popd
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%files
56fc4d
%defattr(-,root,root,-)
56fc4d
%doc AUTHORS CHANGES LICENSE
56fc4d
%if 0%{?with_docs}
56fc4d
%doc docs/_build/html
56fc4d
%endif # with_docs
56fc4d
%doc ext
56fc4d
%doc examples
56fc4d
%{python_sitelib}/*
56fc4d
%exclude %{python_sitelib}/jinja2/_debugsupport.c
56fc4d
56fc4d
56fc4d
%if 0%{?with_python3}
56fc4d
%files -n python3-jinja2
56fc4d
%defattr(-,root,root,-)
56fc4d
%doc AUTHORS CHANGES LICENSE
56fc4d
%if 0%{?with_docs}
56fc4d
%doc docs/_build/html
56fc4d
%endif # with_docs
56fc4d
%doc ext
56fc4d
%doc examples
56fc4d
%{python3_sitelib}/*
56fc4d
%exclude %{python3_sitelib}/jinja2/_debugsupport.c
56fc4d
%endif # with_python3
56fc4d
56fc4d
56fc4d
%changelog
56fc4d
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-6
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
56fc4d
56fc4d
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-5
56fc4d
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
56fc4d
56fc4d
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-4
56fc4d
- remove rhel logic from with_python3 conditional
56fc4d
56fc4d
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-3
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
56fc4d
56fc4d
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-2
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
56fc4d
56fc4d
* Mon Jul 25 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.6-1
56fc4d
- Update to 2.6.
56fc4d
56fc4d
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.5-4
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
56fc4d
56fc4d
* Tue Jan 18 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.5-3
56fc4d
- Re-enable html doc generation.
56fc4d
- Remove conditional for F-12 and below.
56fc4d
- Do not silently fail the testsuite for with py3k.
56fc4d
56fc4d
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 2.5.5-2
56fc4d
- Move python3 runtime requirements to python3 subpackage
56fc4d
56fc4d
* Wed Oct 27 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.5-1
56fc4d
- Update to 2.5.5.
56fc4d
56fc4d
* Wed Aug 25 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.2-4
56fc4d
- Revert to previous behavior: fail the build on failed test.
56fc4d
- Rebuild for Python 3.2.
56fc4d
56fc4d
* Wed Aug 25 2010 Dan Horák <dan[at]danny.cz> - 2.5.2-3
56fc4d
- %%ifnarch doesn't work on noarch package so don't fail the build on failed tests
56fc4d
56fc4d
* Wed Aug 25 2010 Dan Horák <dan[at]danny.cz> - 2.5.2-2
56fc4d
- disable the testsuite on s390(x)
56fc4d
56fc4d
* Thu Aug 19 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.2-1
56fc4d
- Update to upstream version 2.5.2.
56fc4d
- Package depends on python-markupsafe and is noarch now.
56fc4d
56fc4d
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-4
56fc4d
- add explicit build-requirement on python-setuptools
56fc4d
- fix doc disablement for python3 subpackage
56fc4d
56fc4d
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-3
56fc4d
- support disabling documentation in the build to break a circular build-time
56fc4d
dependency with python-sphinx; disable docs for now
56fc4d
56fc4d
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-2
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
56fc4d
56fc4d
* Tue Jul 13 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5-1
56fc4d
- Update to upstream version 2.5.
56fc4d
- Create python3 subpackage. 
56fc4d
- Minor specfile fixes.
56fc4d
- Add examples directory.
56fc4d
- Thanks to Gareth Armstrong for additional hints.
56fc4d
56fc4d
* Wed Apr 21 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.4.1-1
56fc4d
- Update to 2.4.1.
56fc4d
56fc4d
* Tue Apr 13 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.4-1
56fc4d
- Update to 2.4.
56fc4d
56fc4d
* Tue Feb 23 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.1-1
56fc4d
- Update to 2.3.1.
56fc4d
- Docs are built using Sphinx now.
56fc4d
- Run the testsuite.
56fc4d
56fc4d
* Sat Sep 19 2009 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.1-1
56fc4d
- Update to 2.2.1, mainly a bugfix release.
56fc4d
- Remove patch no longer needed.
56fc4d
- Remove conditional for FC-8.
56fc4d
- Compilation of speedup module has to be explicitly requested now.
56fc4d
56fc4d
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-3
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
56fc4d
56fc4d
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-2
56fc4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
56fc4d
56fc4d
* Sat Jan 10 2009 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-1
56fc4d
- Update to 2.1.1 (bugfix release).
56fc4d
56fc4d
* Thu Dec 18 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.1-1
56fc4d
- Update to 2.1, which fixes a number of bugs.
56fc4d
  See http://jinja.pocoo.org/2/documentation/changelog#version-2-1.
56fc4d
56fc4d
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.0-3
56fc4d
- Rebuild for Python 2.6
56fc4d
56fc4d
* Tue Jul 22 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-2
56fc4d
- Use rpm buildroot macro instead of RPM_BUILD_ROOT.
56fc4d
56fc4d
* Sun Jul 20 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-1
56fc4d
- Upstream released 2.0.
56fc4d
56fc4d
* Sun Jun 29 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-0.1.rc1
56fc4d
- Modified specfile from the existing python-jinja package.