ca1215
# python2X and python3X are built form the same module, so we need a conditional
ca1215
# for python[23] bits the state of the conditional is not important in the spec,
ca1215
# it is set in modulemd
ca1215
%bcond_without python2
ca1215
%bcond_without python3
ca1215
%bcond_with python36_module
ca1215
ca1215
# Enable building without docs to avoid a circular dependency between this
ca1215
# and python-sphinx:
ca1215
%if %{with python3}
ca1215
%bcond_without docs
ca1215
%else
ca1215
%bcond_with docs
ca1215
%endif
ca1215
ca1215
%if 0%{?fedora} > 25 || 0%{?rhel} > 7
ca1215
%bcond_without async
ca1215
%else
ca1215
%bcond_with async
ca1215
%endif
ca1215
ca1215
Name:           python-jinja2
ca1215
Version:        2.10
ca1215
Release:        7%{?dist}
ca1215
Summary:        General purpose template engine
ca1215
Group:          Development/Languages
ca1215
License:        BSD
ca1215
URL:            http://jinja.pocoo.org/
ca1215
Source0:        https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz
ca1215
ca1215
BuildArch:      noarch
ca1215
ca1215
%description
ca1215
Jinja2 is a template engine written in pure Python.  It provides a
ca1215
Django inspired non-XML syntax but supports inline expressions and an
ca1215
optional sandboxed environment.
ca1215
ca1215
If you have any exposure to other text-based template languages, such
ca1215
as Smarty or Django, you should feel right at home with Jinja2. It's
ca1215
both designer and developer friendly by sticking to Python's
ca1215
principles and adding functionality useful for templating
ca1215
environments.
ca1215
ca1215
ca1215
%if %{with python2}
ca1215
%package -n python2-jinja2
ca1215
Summary:        General purpose template engine for python2
ca1215
BuildRequires:  python2-devel
ca1215
BuildRequires:  python2-setuptools
ca1215
BuildRequires:  python2-markupsafe
ca1215
BuildRequires:  python2-pytest
ca1215
%if %{with docs}
ca1215
BuildRequires:  %{_bindir}/sphinx-build-3
ca1215
%endif
ca1215
Requires:       python2-babel >= 0.8
ca1215
Requires:       python2-markupsafe
ca1215
Requires:       python2-setuptools
ca1215
%{?python_provide:%python_provide python2-jinja2}
ca1215
ca1215
%description -n python2-jinja2
ca1215
Jinja2 is a template engine written in pure Python.  It provides a
ca1215
Django inspired non-XML syntax but supports inline expressions and an
ca1215
optional sandboxed environment.
ca1215
ca1215
If you have any exposure to other text-based template languages, such
ca1215
as Smarty or Django, you should feel right at home with Jinja2. It's
ca1215
both designer and developer friendly by sticking to Python's
ca1215
principles and adding functionality useful for templating
ca1215
environments.
ca1215
%endif # with python2
ca1215
ca1215
ca1215
%if %{with python3}
ca1215
%package -n python3-jinja2
ca1215
Summary:        General purpose template engine for python3
ca1215
Group:          Development/Languages
ca1215
BuildRequires:  python3-devel
ca1215
BuildRequires:  python3-setuptools
ca1215
BuildRequires:  python3-babel >= 0.8
ca1215
BuildRequires:  python3-markupsafe
ca1215
BuildRequires:  python3-pytest
ca1215
%if %{with docs}
ca1215
BuildRequires:  %{_bindir}/sphinx-build-3
ca1215
%endif
ca1215
Requires:       python3-babel >= 0.8
ca1215
Requires:       python3-markupsafe
ca1215
Requires:       python3-setuptools
ca1215
%{?python_provide:%python_provide python3-jinja2}
ca1215
ca1215
%description -n python3-jinja2
ca1215
Jinja2 is a template engine written in pure Python.  It provides a
ca1215
Django inspired non-XML syntax but supports inline expressions and an
ca1215
optional sandboxed environment.
ca1215
ca1215
If you have any exposure to other text-based template languages, such
ca1215
as Smarty or Django, you should feel right at home with Jinja2. It's
ca1215
both designer and developer friendly by sticking to Python's
ca1215
principles and adding functionality useful for templating
ca1215
environments.
ca1215
%endif # with python3
ca1215
ca1215
ca1215
%prep
ca1215
%setup -qc -n Jinja2-%{version}
ca1215
# cleanup
ca1215
find Jinja2-%{version} -name '*.pyo' -o -name '*.pyc' -delete
ca1215
ca1215
# fix EOL
ca1215
sed -i 's|\r$||g' Jinja2-%{version}/LICENSE
ca1215
ca1215
mv Jinja2-%{version} python3
ca1215
%if %{with python2}
ca1215
cp -av python3 python2
ca1215
%endif # with python2
ca1215
ca1215
%build
ca1215
%if %{with python2}
ca1215
pushd python2
ca1215
%py2_build
ca1215
ca1215
popd
ca1215
%endif # with python2
ca1215
ca1215
%if %{with python3}
ca1215
pushd python3
ca1215
%py3_build
ca1215
%if %{with docs}
ca1215
make -C docs html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3
ca1215
# remove hidden file
ca1215
rm -rf docs/_build/html/.buildinfo
ca1215
%endif # with docs
ca1215
popd
ca1215
%endif # with python3
ca1215
ca1215
ca1215
%install
ca1215
%if %{with python2}
ca1215
pushd python2
ca1215
%py2_install
ca1215
ca1215
# these files are valid only on Python 3.6+
ca1215
rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py
ca1215
rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py
ca1215
popd
ca1215
%endif # with python2
ca1215
ca1215
%if %{with python3}
ca1215
pushd python3
ca1215
%py3_install
ca1215
ca1215
%if ! %{with async}
ca1215
# these files are valid only on Python 3.6+
ca1215
rm %{buildroot}%{python3_sitelib}/jinja2/asyncsupport.py
ca1215
rm %{buildroot}%{python3_sitelib}/jinja2/asyncfilters.py
ca1215
%endif # ! with async
ca1215
popd
ca1215
%endif # with python3
ca1215
ca1215
ca1215
%check
ca1215
%if %{with python2}
ca1215
pushd python2
ca1215
# there are currently no tests in the jinja2 tarball
ca1215
# make test
ca1215
popd
ca1215
%endif # with python2
ca1215
ca1215
%if %{with python3}
ca1215
pushd python3
ca1215
# there are currently no tests in the jinja2 tarball
ca1215
# make test
ca1215
popd
ca1215
%endif # with python3
ca1215
ca1215
ca1215
%if %{with python2}
ca1215
%files -n python2-jinja2
ca1215
%doc python2/AUTHORS
ca1215
%doc python2/CHANGES.rst
ca1215
%doc python2/ext
ca1215
%doc python2/examples
ca1215
%license python2/LICENSE
ca1215
%{python2_sitelib}/jinja2
ca1215
%{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info
ca1215
%endif # with python2
ca1215
ca1215
ca1215
%if %{with python3}
ca1215
%files -n python3-jinja2
ca1215
%doc python3/AUTHORS
ca1215
%doc python3/CHANGES.rst
ca1215
%doc python3/ext
ca1215
%doc python3/examples
ca1215
%license python3/LICENSE
ca1215
%if %{with docs}
ca1215
%doc python3/docs/_build/html
ca1215
%endif
ca1215
%{python3_sitelib}/jinja2
ca1215
%{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info
ca1215
%endif # with python3
ca1215
ca1215
ca1215
%changelog
ca1215
* Sat Aug 04 2018 Lumír Balhar <lbalhar@redhat.com> - 2.10-7
ca1215
- Fix conditions
ca1215
ca1215
* Sat Aug 04 2018 Lumír Balhar <lbalhar@redhat.com> - 2.10-6
ca1215
- Specfile cleanup and fixes
ca1215
ca1215
* Mon Jun 25 2018 Lumír Balhar <Lbalhar@redhat.com> - 2.10-5
ca1215
- Disable Python 2 build by default
ca1215
ca1215
* Mon Jun 25 2018 Lumír Balhar <Lbalhar@redhat.com> - 2.10-4
ca1215
- Allow build with Python 2
ca1215
ca1215
* Mon May 28 2018 Petr Viktorin <pviktori@redhat.com> - 2.10-3
ca1215
- Remove docs from Python 2 package
ca1215
- Remove dependency on python2-babel and python2-sphinx
ca1215
ca1215
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.10-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ca1215
ca1215
* Thu Nov 16 2017 Thomas Moschny <thomas.moschny@gmx.de> - 2.10-1
ca1215
- Update to 2.10.
ca1215
- Use %%bcond.
ca1215
- Move BRs to their respective subpackages.
ca1215
ca1215
* Fri Oct 20 2017 Troy Dawson <tdawson@redhat.com> - 2.9.6-4
ca1215
- Really cleanup spec file conditionals
ca1215
ca1215
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 2.9.6-3
ca1215
- Cleanup spec file conditionals
ca1215
ca1215
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ca1215
ca1215
* Wed Apr  5 2017 Thomas Moschny <thomas.moschny@gmx.de> - 2.9.6-1
ca1215
- Update to 2.9.6.
ca1215
ca1215
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.5-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ca1215
ca1215
* Sun Jan 29 2017 Thomas Moschny <thomas.moschny@gmx.de> - 2.9.5-1
ca1215
- Update to 2.9.5.
ca1215
ca1215
* Fri Jan 13 2017 Thomas Moschny <thomas.moschny@gmx.de> - 2.9.4-1
ca1215
- Update to 2.9.4.
ca1215
ca1215
* Sat Dec 31 2016 Thomas Moschny <thomas.moschny@gmx.de> - 2.8.1-1
ca1215
- Update to 2.8.1.
ca1215
ca1215
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 2.8-8
ca1215
- Rebuild for Python 3.6
ca1215
ca1215
* Thu Sep 22 2016 Orion Poplawski <orion@cora.nwra.com> - 2.8-7
ca1215
- Ship python2-jinja2 (bug #1378519)
ca1215
- Modernize spec
ca1215
ca1215
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8-6
ca1215
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ca1215
ca1215
* Fri Feb  5 2016 Thomas Moschny <thomas.moschny@gmx.de> - 2.8-5
ca1215
- Do not call py.test, there are currently no tests in the tarball.
ca1215
ca1215
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.8-4
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ca1215
ca1215
* Mon Oct 12 2015 Robert Kuska <rkuska@redhat.com> - 2.8-3
ca1215
- Rebuilt for Python3.5 rebuild
ca1215
ca1215
* Mon Jul 27 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.8-2
ca1215
- Apply updates Python packaging guidelines.
ca1215
- Mark LICENSE with %%license.
ca1215
ca1215
* Sun Jul 26 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8-1
ca1215
- Upstream 2.8
ca1215
ca1215
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-3
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ca1215
ca1215
* Tue Dec 2 2014 Orion Poplawski <orion@cora.nwra.com> - 2.7.3-2
ca1215
- Add Requires python(3)-setuptools (bug #1168774)
ca1215
ca1215
* Sat Jun  7 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.3-1
ca1215
- Update to 2.7.3.
ca1215
- Reenable docs.
ca1215
ca1215
* Sat May 10 2014 Orion Poplawski <orion@cora.nwra.com> - 2.7.2-2
ca1215
- Bootstrap (without docs) build for Python 3.4
ca1215
ca1215
* Fri Jan 10 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.2-1
ca1215
- Update to 2.7.2.
ca1215
- Update python3 conditional.
ca1215
ca1215
* Fri Aug 16 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.1-1
ca1215
- Update to 2.7.1.
ca1215
ca1215
* Thu Jul 25 2013 Orion Poplawski <orion@cora.nwra.com> - 2.7-1
ca1215
- Update to 2.7
ca1215
- spec cleanup
ca1215
ca1215
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-6
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ca1215
ca1215
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-5
ca1215
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
ca1215
ca1215
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-4
ca1215
- remove rhel logic from with_python3 conditional
ca1215
ca1215
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-3
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
ca1215
ca1215
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ca1215
ca1215
* Mon Jul 25 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.6-1
ca1215
- Update to 2.6.
ca1215
ca1215
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.5-4
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ca1215
ca1215
* Tue Jan 18 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.5-3
ca1215
- Re-enable html doc generation.
ca1215
- Remove conditional for F-12 and below.
ca1215
- Do not silently fail the testsuite for with py3k.
ca1215
ca1215
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 2.5.5-2
ca1215
- Move python3 runtime requirements to python3 subpackage
ca1215
ca1215
* Wed Oct 27 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.5-1
ca1215
- Update to 2.5.5.
ca1215
ca1215
* Wed Aug 25 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.2-4
ca1215
- Revert to previous behavior: fail the build on failed test.
ca1215
- Rebuild for Python 3.2.
ca1215
ca1215
* Wed Aug 25 2010 Dan Horák <dan[at]danny.cz> - 2.5.2-3
ca1215
- %%ifnarch doesn't work on noarch package so don't fail the build on failed tests
ca1215
ca1215
* Wed Aug 25 2010 Dan Horák <dan[at]danny.cz> - 2.5.2-2
ca1215
- disable the testsuite on s390(x)
ca1215
ca1215
* Thu Aug 19 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.2-1
ca1215
- Update to upstream version 2.5.2.
ca1215
- Package depends on python-markupsafe and is noarch now.
ca1215
ca1215
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-4
ca1215
- add explicit build-requirement on python-setuptools
ca1215
- fix doc disablement for python3 subpackage
ca1215
ca1215
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-3
ca1215
- support disabling documentation in the build to break a circular build-time
ca1215
dependency with python-sphinx; disable docs for now
ca1215
ca1215
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ca1215
ca1215
* Tue Jul 13 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.5-1
ca1215
- Update to upstream version 2.5.
ca1215
- Create python3 subpackage.
ca1215
- Minor specfile fixes.
ca1215
- Add examples directory.
ca1215
- Thanks to Gareth Armstrong for additional hints.
ca1215
ca1215
* Wed Apr 21 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.4.1-1
ca1215
- Update to 2.4.1.
ca1215
ca1215
* Tue Apr 13 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.4-1
ca1215
- Update to 2.4.
ca1215
ca1215
* Tue Feb 23 2010 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.1-1
ca1215
- Update to 2.3.1.
ca1215
- Docs are built using Sphinx now.
ca1215
- Run the testsuite.
ca1215
ca1215
* Sat Sep 19 2009 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.1-1
ca1215
- Update to 2.2.1, mainly a bugfix release.
ca1215
- Remove patch no longer needed.
ca1215
- Remove conditional for FC-8.
ca1215
- Compilation of speedup module has to be explicitly requested now.
ca1215
ca1215
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-3
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ca1215
ca1215
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-2
ca1215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
ca1215
ca1215
* Sat Jan 10 2009 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-1
ca1215
- Update to 2.1.1 (bugfix release).
ca1215
ca1215
* Thu Dec 18 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.1-1
ca1215
- Update to 2.1, which fixes a number of bugs.
ca1215
  See http://jinja.pocoo.org/2/documentation/changelog#version-2-1.
ca1215
ca1215
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.0-3
ca1215
- Rebuild for Python 2.6
ca1215
ca1215
* Tue Jul 22 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-2
ca1215
- Use rpm buildroot macro instead of RPM_BUILD_ROOT.
ca1215
ca1215
* Sun Jul 20 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-1
ca1215
- Upstream released 2.0.
ca1215
ca1215
* Sun Jun 29 2008 Thomas Moschny <thomas.moschny@gmx.de> - 2.0-0.1.rc1
ca1215
- Modified specfile from the existing python-jinja package.