python-jinja2/python-jinja2.spec
2024-12-15 12:01:08 +08:00

187 lines
4.6 KiB
RPMSpec

%global _name Jinja2
Name: python-jinja2
Version: 2.11.2
Release: 8
Summary: A full-featured template engine for Python
License: BSD
URL: http://jinja.pocoo.org/
Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz
Patch6000: backport-CVE-2020-28493.patch
Patch6001: backport-CVE-2024-22195.patch
Patch6002: backport-CVE-2024-34064.patch
Patch9000: huawei-replace-instances-of-the-older-style-tmpdir-fixture.patch
Patch9001: backport-CVE-2024-56326.patch
Patch9002: backport-CVE-2024-56326-2.patch
Patch9003: backport-CVE-2024-56326-3.patch
BuildArch: noarch
%description
Jinja2 is one of the most used template engines for Python. It is inspired by Django's
templating system but extends it with an expressive language that gives template authors
a more powerful set of tools. On top of that it adds sandboxed execution and optional
automatic escaping for applications where security is important.
%if %{with python2}
%package -n python2-jinja2
Summary: General purpose template engine for python2
BuildRequires: python2-markupsafe python2-babel
BuildRequires: python2-pytest python2-devel python2-setuptools
Requires: python2-babel python2-markupsafe python2-setuptools
%{?python_provide:%python_provide python2-jinja2}
%description -n python2-jinja2
This package is the python2 version of python-jinja2.
%endif
%package -n python3-jinja2
Summary: General purpose template engine for python3
BuildRequires: python3-markupsafe python3-babel
BuildRequires: python3-pytest python3-devel python3-setuptools
Requires: python3-babel python3-markupsafe python3-setuptools
%{?python_provide:%python_provide python3-jinja2}
%description -n python3-jinja2
This package is the python3 version of python-jinja2.
%package_help
%prep
%autosetup -c -n Jinja2-%{version} -p1
# fix EOL
sed -i 's|\r$||g' Jinja2-%{version}/LICENSE.rst
cp -a Jinja2-%{version} python3
%build
%if %{with python2}
pushd Jinja2-%{version}
%py2_build
popd
%endif
pushd python3
%py3_build
popd
%install
%if %{with python2}
pushd Jinja2-%{version}
%py2_install
#valid on python above 3.6, if not removed, installation will fail
rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py
rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py
popd
%endif
pushd python3
%py3_install
popd
%check
%if %{with python2}
pushd Jinja2-%{version}
PYTHONPATH=$(pwd)/src %{__python2} -m pytest tests
popd
%endif
pushd python3
PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests
popd
%if %{with python2}
%files -n python2-jinja2
%license Jinja2-%{version}/LICENSE.rst
%{python2_sitelib}/jinja2
%{python2_sitelib}/Jinja2*-info
%endif
%files -n python3-jinja2
%license Jinja2-%{version}/LICENSE.rst
%{python3_sitelib}/jinja2
%{python3_sitelib}/Jinja2*-info
%files help
%doc Jinja2-%{version}/CHANGES.rst Jinja2-%{version}/PKG-INFO
%doc Jinja2-%{version}/ext Jinja2-%{version}/examples
%changelog
* Wed Dec 25 2024 changtao <changtao@kylinos.cn> - 2.11.2-8
Type:CVE
CVE:CVE-2024-56326
SUG:NA
DESC:fix CVE-2024-56326
* Fri May 10 2024 weihaohao <weihaohao2@huawei.com> - 2.11.2-7
Type:CVE
CVE:CVE-2024-34064
SUG:NA
DESC:fix CVE-2024-34064
* Fri Jan 26 2024 zhuofeng <zhuofeng2@huawei.com> - 2.11.2-6
Type:bugfix
CVE:NA
SUG:NA
DESC:make the test check and adapt python2 grammer
* Thu Jan 25 2024 zhuofeng <zhuofeng2@huawei.com> - 2.11.2-5
Type:bugfix
CVE:NA
SUG:NA
DESC:add python2 and adpat python2
* Mon Jan 22 2024 weihaohao <weihaohao2@huawei.com> - 2.11.2-4
Type:CVE
CVE:CVE-2024-22195
SUG:NA
DESC:fix CVE-2024-22195,remove python2
* Sat Feb 18 2023 zhuofeng <zhuofeng2@huawei.com> - 2.11.2-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:make the test check
* Fri Apr 23 2021 shangyibin<shangyibin1@huawei.com> - 2.11.2-2
- Type:NA
- ID:CVE-2020-28493
- SUG:NA
- DESC:fix cve-2020-28493
* Mon Aug 31 2020 shixuantong <shixuantong@huawei.com> - 2.11.2
- Type:NA
- ID:NA
- SUG:NA
- DESC:update version to 2.11.2
* Sat Sep 21 2019 shenyangyang <shenyangyang4@huawei.com> - 2.10-10
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:revise description
* Mon Sep 15 2019 shenyangyang <shenyangyang4@huawei.com> - 2.10-9
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:strenthen spec
* Fri Aug 16 2019 Enbo Kang <kangenbo@huawei.com> - 2.10-8
- Type:security
- ID:CVE-2019-10906
- SUG:NA
- DESC:fix CVE-2019-10906 python-jinja2:str.format_map allows sandbox
* Mon Aug 12 2019 alex chen <alex.chen@huawei.com> - 2.10-7
- Enable python2 build by default
* Wed Jul 18 2018 openEuler Buildteam <buildteam@openeuler.org> - 2.10-6
- Package init