]>
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: 2.11.3 | |
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: 231dc00d34afb2672c497713fa9cdaaa | |
17 | URL: http://jinja.pocoo.org/ | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: python3-devel >= 1:3.5 | |
21 | BuildRequires: python3-modules >= 1:3.5 | |
22 | BuildRequires: python3-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python3-markupsafe >= 0.23 | |
25 | BuildRequires: python3-pytest | |
26 | %endif | |
27 | %if %{with doc} | |
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 | |
32 | %endif | |
33 | BuildArch: noarch | |
34 | Requires: python3-modules >= 1:3.5 | |
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 | |
39 | in pure Python. Provides a Django inspired non-XML syntax but supports | |
40 | inline expressions and an optional sandboxed environment. | |
41 | ||
42 | %description -l pl.UTF-8 | |
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 | ||
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 | ||
59 | %prep | |
60 | %setup -q -n Jinja2-%{version} | |
61 | ||
62 | %build | |
63 | %py3_build | |
64 | ||
65 | %if %{with tests} | |
66 | PYTHONPATH=$(pwd)/src \ | |
67 | %{__python3} -m pytest tests | |
68 | %endif | |
69 | ||
70 | %if %{with doc} | |
71 | PYTHONPATH=$(pwd) \ | |
72 | %{__make} -C docs -j1 html \ | |
73 | SPHINXBUILD=sphinx-build-3 | |
74 | %endif | |
75 | ||
76 | %install | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | %py3_install | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
85 | %doc CHANGES.rst LICENSE.rst README.rst | |
86 | %{py3_sitescriptdir}/%{module} | |
87 | %{py3_sitescriptdir}/Jinja2-%{version}-py*.egg-info | |
88 | ||
89 | %if %{with doc} | |
90 | %files apidoc | |
91 | %defattr(644,root,root,755) | |
92 | %doc docs/_build/html/{_static,*.html,*.js} | |
93 | %endif |