]>
Commit | Line | Data |
---|---|---|
49a8d543 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
4 | %bcond_without tests # unit tests | |
49a8d543 ER |
5 | |
6 | %define module jinja2 | |
36aca28e ER |
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} | |
c9fbe927 JB |
10 | Version: 3.1.2 |
11 | Release: 1 | |
e6068581 ER |
12 | License: BSD |
13 | Group: Development/Languages/Python | |
49a8d543 ER |
14 | #Source0Download: https://pypi.org/simple/Jinja2 |
15 | Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz | |
c9fbe927 JB |
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 | |
49a8d543 | 21 | BuildRequires: rpmbuild(macros) >= 1.714 |
e6068581 | 22 | BuildRequires: rpm-pythonprov |
49a8d543 | 23 | %if %{with tests} |
c9fbe927 | 24 | BuildRequires: python3-babel >= 2.7 |
9236b024 | 25 | BuildRequires: python3-markupsafe >= 2.0 |
49a8d543 ER |
26 | BuildRequires: python3-pytest |
27 | %endif | |
e6068581 | 28 | %if %{with doc} |
49a8d543 ER |
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 | |
e6068581 | 33 | %endif |
49a8d543 | 34 | BuildArch: noarch |
c9fbe927 | 35 | Requires: python3-modules >= 1:3.7 |
e6068581 ER |
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 | |
49a8d543 | 40 | in pure Python. Provides a Django inspired non-XML syntax but supports |
e6068581 ER |
41 | inline expressions and an optional sandboxed environment. |
42 | ||
e6068581 | 43 | %description -l pl.UTF-8 |
49a8d543 ER |
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 | ||
49a8d543 ER |
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 | ||
e6068581 ER |
60 | %prep |
61 | %setup -q -n Jinja2-%{version} | |
62 | ||
63 | %build | |
49a8d543 ER |
64 | %py3_build |
65 | ||
66 | %if %{with tests} | |
c9fbe927 | 67 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
49a8d543 ER |
68 | PYTHONPATH=$(pwd)/src \ |
69 | %{__python3} -m pytest tests | |
70 | %endif | |
49a8d543 | 71 | |
e6068581 | 72 | %if %{with doc} |
49a8d543 ER |
73 | PYTHONPATH=$(pwd) \ |
74 | %{__make} -C docs -j1 html \ | |
75 | SPHINXBUILD=sphinx-build-3 | |
e6068581 ER |
76 | %endif |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
49a8d543 | 80 | %py3_install |
e6068581 ER |
81 | |
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
49a8d543 | 87 | %doc CHANGES.rst LICENSE.rst README.rst |
e6068581 | 88 | %{py3_sitescriptdir}/%{module} |
49a8d543 | 89 | %{py3_sitescriptdir}/Jinja2-%{version}-py*.egg-info |
49a8d543 ER |
90 | |
91 | %if %{with doc} | |
92 | %files apidoc | |
93 | %defattr(644,root,root,755) | |
94 | %doc docs/_build/html/{_static,*.html,*.js} | |
95 | %endif |