SPECS/python-jinja2/python-jinja2.spec
2d879f6b
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
b2bb0264
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 %{!?python3_version: %define python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
 
1c0999db
 Name:           python-jinja2
7404bf19
 Version:        2.10
 Release:        1%{?dist}
1c0999db
 Url:            http://jinja.pocoo.org/
 Summary:        A fast and easy to use template engine written in pure Python
 License:        BSD
 Group:          Development/Languages/Python
 Vendor:         VMware, Inc.
 Distribution:   Photon
7404bf19
 Source0:        https://pypi.python.org/packages/71/59/d7423bd5e7ddaf3a1ce299ab4490e9044e8dfd195420fc83a24de9e60726/Jinja2-%{version}.tar.gz
 %define sha1    Jinja2=34b69e5caab12ee37b9df69df9018776c008b7b8
1c0999db
 BuildRequires:  python2
 BuildRequires:  python2-libs
 BuildRequires:  python-setuptools
b2bb0264
 BuildRequires:  python-markupsafe
1c0999db
 Requires:       python2
 Requires:       python2-libs
b2bb0264
 Requires:       python-markupsafe
421d1f6b
 BuildArch:      noarch
1c0999db
 
 %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.
 
b2bb0264
 %package -n     python3-jinja2
 Summary:        A fast and easy to use template engine written in pure Python
 BuildRequires:  python3
 BuildRequires:  python3-devel
 BuildRequires:  python3-markupsafe
a848bcf8
 BuildRequires:  python3-setuptools
 BuildRequires:  python3-xml
b2bb0264
 Requires:       python3
 Requires:       python3-libs
 Requires:       python3-markupsafe
 
 %description -n python3-jinja2
 
 Python 3 version.
 
1c0999db
 %prep
 %setup -q -n Jinja2-%{version}
b2bb0264
 rm -rf ../p3dir
 cp -a . ../p3dir
1c0999db
 
 %build
2d879f6b
 python2 setup.py build
1c0999db
 sed -i 's/\r$//' LICENSE # Fix wrong EOL encoding
b2bb0264
 pushd ../p3dir
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 sed -i 's/\r$//' LICENSE # Fix wrong EOL encoding
 popd
1c0999db
 
 %install
2d879f6b
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
b2bb0264
 pushd ../p3dir
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 popd
1c0999db
 
 %check
 make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
 
 %files
 %defattr(-,root,root)
7404bf19
 %doc AUTHORS
1c0999db
 %license LICENSE
2d879f6b
 %{python2_sitelib}/jinja2
 %{python2_sitelib}/Jinja2-%{version}-py%{python_version}.egg-info
1c0999db
 
b2bb0264
 %files -n python3-jinja2
 %defattr(-,root,root)
7404bf19
 %doc AUTHORS
b2bb0264
 %license LICENSE
 %{python3_sitelib}/jinja2
 %{python3_sitelib}/Jinja2-%{version}-py%{python3_version}.egg-info
 
1c0999db
 %changelog
7404bf19
 *   Sun Sep 09 2018 Tapas Kundu <tkundu@vmware.com> 2.10-1
 -   Update to version 2.10
a848bcf8
 *   Tue Jun 20 2017 Xiaolin Li <xiaolinl@vmware.com> 2.9.5-6
 -   Add python3-setuptools and python3-xml to python3 sub package Buildrequires.
2d879f6b
 *   Thu Jun 15 2017 Dheeraj Shetty <dheerajs@vmware.com> 2.9.5-5
 -   Change python to python2
8e1ff2e6
 *   Mon Jun 12 2017 Kumar Kaushik <kaushikk@vmware.com> 2.9.5-4
 -   Fixing import error in python3.
b2bb0264
 *   Wed Apr 26 2017 Dheeraj Shetty <dheerajs@vmware.com> 2.9.5-3
 -   BuildRequires python-markupsafe , creating subpackage python3-jinja2
421d1f6b
 *   Tue Apr 25 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.9.5-2
 -   Fix arch
bfd9864f
 *   Mon Mar 27 2017 Sarah Choi <sarahc@vmware.com> 2.9.5-1
 -   Upgrade version to 2.9.5 
1c0999db
 *   Tue Dec 13 2016 Dheeraj Shetty <dheerajs@vmware.com> 2.8-1
 -   Initial packaging for Photon