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