]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module jinja2 | |
7 | Summary: Template engine Jinja2 for Python 3.x | |
8 | Summary(pl.UTF-8): Silnik szablonów Jinja2 dla Pythona 3.x | |
9 | Name: python3-%{module} | |
10 | Version: 3.1.2 | |
11 | Release: 1 | |
12 | License: BSD | |
13 | Group: Development/Languages/Python | |
14 | #Source0Download: https://pypi.org/simple/Jinja2 | |
15 | Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz | |
16 | # Source0-md5: d31148abd89c1df1cdb077a55db27d02 | |
17 | URL: https://jinja.palletsprojects.com/en/3.1.x/ | |
18 | BuildRequires: python3-devel >= 1:3.7 | |
19 | BuildRequires: python3-modules >= 1:3.7 | |
20 | BuildRequires: python3-setuptools | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | BuildRequires: rpm-pythonprov | |
23 | %if %{with tests} | |
24 | BuildRequires: python3-babel >= 2.7 | |
25 | BuildRequires: python3-markupsafe >= 2.0 | |
26 | BuildRequires: python3-pytest | |
27 | %endif | |
28 | %if %{with doc} | |
29 | BuildRequires: python3-pallets-sphinx-themes >= 1.2.0 | |
30 | BuildRequires: python3-sphinxcontrib-log-cabinet >= 1.0.1 | |
31 | BuildRequires: python3-sphinx_issues >= 1.2.0 | |
32 | BuildRequires: sphinx-pdg-3 >= 2.1.2 | |
33 | %endif | |
34 | BuildArch: noarch | |
35 | Requires: python3-modules >= 1:3.7 | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | A small but fast and easy to use stand-alone template engine written | |
40 | in pure Python. Provides a Django inspired non-XML syntax but supports | |
41 | inline expressions and an optional sandboxed environment. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Mały ale szybki i łatwy w użyciu samodzielny silnik szablonów napisany | |
45 | w czystym Pythonie. Udostępnia podobne do Django, o odmiennej od XML-a | |
46 | składni i kompilowane do kodu Pythona szablony w opcjonalnie | |
47 | ograniczonym środowisku. | |
48 | ||
49 | %package apidoc | |
50 | Summary: Jinja2 template engine API documentation | |
51 | Summary(pl.UTF-8): Dokumentacja API silnika szablonów Jinja2 | |
52 | Group: Development/Languages/Python | |
53 | ||
54 | %description apidoc | |
55 | API documentation for Jinja2 template engine. | |
56 | ||
57 | %description apidoc -l pl.UTF-8 | |
58 | Dokumentacja API silnika szablonów Jinja2. | |
59 | ||
60 | %prep | |
61 | %setup -q -n Jinja2-%{version} | |
62 | ||
63 | %build | |
64 | %py3_build | |
65 | ||
66 | %if %{with tests} | |
67 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
68 | PYTHONPATH=$(pwd)/src \ | |
69 | %{__python3} -m pytest tests | |
70 | %endif | |
71 | ||
72 | %if %{with doc} | |
73 | PYTHONPATH=$(pwd) \ | |
74 | %{__make} -C docs -j1 html \ | |
75 | SPHINXBUILD=sphinx-build-3 | |
76 | %endif | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | %py3_install | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %doc CHANGES.rst LICENSE.rst README.rst | |
88 | %{py3_sitescriptdir}/%{module} | |
89 | %{py3_sitescriptdir}/Jinja2-%{version}-py*.egg-info | |
90 | ||
91 | %if %{with doc} | |
92 | %files apidoc | |
93 | %defattr(644,root,root,755) | |
94 | %doc docs/_build/html/{_static,*.html,*.js} | |
95 | %endif |