]>
Commit | Line | Data |
---|---|---|
bd8c7cd4 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
1cb8c72c | 4 | %bcond_without tests # unit tests |
bd8c7cd4 | 5 | %bcond_without python2 # Python 2.x modules |
4d1855ce | 6 | %bcond_with python3 # Python 3.x modules, python3 is built from python3-jinja2.spec |
22da3d42 ER |
7 | |
8 | %define module jinja2 | |
bd8c7cd4 JB |
9 | Summary: Jinja2 Template engine for Python 2.x |
10 | Summary(pl.UTF-8): Silnik szablonów Jinja2 dla Pythona 2.x | |
32bc8461 | 11 | Name: python-%{module} |
c968238f JP |
12 | Version: 2.11.3 |
13 | Release: 1 | |
32bc8461 MK |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
6fb399b6 | 16 | #Source0Download: https://pypi.org/simple/Jinja2 |
50bf5fce | 17 | Source0: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz |
c968238f | 18 | # Source0-md5: 231dc00d34afb2672c497713fa9cdaaa |
0624055f | 19 | URL: https://jinja.palletsprojects.com/ |
7de1498d | 20 | BuildRequires: rpmbuild(macros) >= 1.714 |
196bf8af | 21 | BuildRequires: rpm-pythonprov |
63775cd9 | 22 | %if %{with python2} |
1cb8c72c | 23 | BuildRequires: python-devel >= 1:2.7 |
de2c695c | 24 | BuildRequires: python-setuptools |
1cb8c72c JB |
25 | %if %{with tests} |
26 | BuildRequires: python-markupsafe >= 0.23 | |
27 | BuildRequires: python-pytest | |
28 | %endif | |
63775cd9 AF |
29 | %endif |
30 | %if %{with python3} | |
1cb8c72c JB |
31 | BuildRequires: python3-devel >= 1:3.5 |
32 | BuildRequires: python3-modules >= 1:3.5 | |
f1a9449f | 33 | BuildRequires: python3-setuptools |
1cb8c72c JB |
34 | %if %{with tests} |
35 | BuildRequires: python3-markupsafe >= 0.23 | |
36 | BuildRequires: python3-pytest | |
37 | %endif | |
63775cd9 | 38 | %endif |
bb2732e3 | 39 | %if %{with doc} |
d630e4b9 JB |
40 | BuildRequires: python3-pallets-sphinx-themes >= 1.2.0 |
41 | BuildRequires: python3-sphinxcontrib-log-cabinet >= 1.0.1 | |
42 | BuildRequires: python3-sphinx_issues >= 1.2.0 | |
43 | BuildRequires: sphinx-pdg-3 >= 2.1.2 | |
bb2732e3 | 44 | %endif |
1cb8c72c | 45 | Requires: python-modules >= 1:2.7 |
0624055f | 46 | Obsoletes: python-Jinja2 < 2.7 |
22da3d42 | 47 | BuildArch: noarch |
32bc8461 MK |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
50 | %description | |
51 | A small but fast and easy to use stand-alone template engine written | |
bd8c7cd4 | 52 | in pure Python. Provides a Django inspired non-XML syntax but supports |
32bc8461 MK |
53 | inline expressions and an optional sandboxed environment. |
54 | ||
32bc8461 | 55 | %description -l pl.UTF-8 |
bd8c7cd4 JB |
56 | Mały ale szybki i łatwy w użyciu samodzielny silnik szablonów napisany |
57 | w czystym Pythonie. Udostępnia podobne do Django, o odmiennej od XML-a | |
58 | składni i kompilowane do kodu Pythona szablony w opcjonalnie | |
32bc8461 MK |
59 | ograniczonym środowisku. |
60 | ||
63775cd9 | 61 | %package -n python3-%{module} |
bd8c7cd4 | 62 | Summary: Template engine Jinja2 for Python 3.x |
22da3d42 ER |
63 | Summary(pl.UTF-8): Silnik szablonów Jinja2 dla Pythona 3.x |
64 | Group: Development/Languages/Python | |
1cb8c72c | 65 | Requires: python3-modules >= 1:3.5 |
63775cd9 | 66 | |
5742e286 | 67 | %description -n python3-%{module} |
63775cd9 | 68 | A small but fast and easy to use stand-alone template engine written |
bd8c7cd4 | 69 | in pure Python. Provides a Django inspired non-XML syntax but supports |
63775cd9 AF |
70 | inline expressions and an optional sandboxed environment. |
71 | ||
72 | %description -n python3-%{module} -l pl.UTF-8 | |
bd8c7cd4 JB |
73 | Mały ale szybki i łatwy w użyciu samodzielny silnik szablonów napisany |
74 | w czystym Pythonie. Udostępnia podobne do Django, o odmiennej od XML-a | |
75 | składni i kompilowane do kodu Pythona szablony w opcjonalnie | |
63775cd9 AF |
76 | ograniczonym środowisku. |
77 | ||
78 | %package apidoc | |
79 | Summary: Jinja2 template engine API documentation | |
bd8c7cd4 | 80 | Summary(pl.UTF-8): Dokumentacja API silnika szablonów Jinja2 |
22da3d42 | 81 | Group: Development/Languages/Python |
63775cd9 AF |
82 | |
83 | %description apidoc | |
bd8c7cd4 JB |
84 | API documentation for Jinja2 template engine. |
85 | ||
86 | %description apidoc -l pl.UTF-8 | |
87 | Dokumentacja API silnika szablonów Jinja2. | |
63775cd9 | 88 | |
32bc8461 MK |
89 | %prep |
90 | %setup -q -n Jinja2-%{version} | |
91 | ||
92 | %build | |
63775cd9 | 93 | %if %{with python2} |
d831097c | 94 | %py_build |
1cb8c72c JB |
95 | |
96 | %if %{with tests} | |
d630e4b9 | 97 | PYTHONPATH=$(pwd)/src \ |
1cb8c72c JB |
98 | %{__python} -m pytest tests |
99 | %endif | |
63775cd9 | 100 | %endif |
1cb8c72c | 101 | |
63775cd9 | 102 | %if %{with python3} |
d831097c | 103 | %py3_build |
1cb8c72c JB |
104 | |
105 | %if %{with tests} | |
d630e4b9 | 106 | PYTHONPATH=$(pwd)/src \ |
1cb8c72c JB |
107 | %{__python3} -m pytest tests |
108 | %endif | |
63775cd9 AF |
109 | %endif |
110 | ||
bb2732e3 | 111 | %if %{with doc} |
6fb399b6 JB |
112 | PYTHONPATH=$(pwd) \ |
113 | %{__make} -C docs -j1 html \ | |
94e1f0ec | 114 | SPHINXBUILD=sphinx-build-3 |
bb2732e3 | 115 | %endif |
32bc8461 MK |
116 | |
117 | %install | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
63775cd9 | 120 | %if %{with python2} |
d831097c | 121 | %py_install |
32bc8461 MK |
122 | |
123 | %py_postclean | |
63775cd9 AF |
124 | %endif |
125 | ||
126 | %if %{with python3} | |
d831097c | 127 | %py3_install |
63775cd9 | 128 | %endif |
32bc8461 MK |
129 | |
130 | %clean | |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
63775cd9 | 133 | %if %{with python2} |
32bc8461 MK |
134 | %files |
135 | %defattr(644,root,root,755) | |
1cb8c72c | 136 | %doc CHANGES.rst LICENSE.rst README.rst |
63775cd9 | 137 | %{py_sitescriptdir}/%{module} |
bd8c7cd4 | 138 | %{py_sitescriptdir}/Jinja2-%{version}-py*.egg-info |
63775cd9 AF |
139 | %endif |
140 | ||
141 | %if %{with python3} | |
142 | %files -n python3-%{module} | |
143 | %defattr(644,root,root,755) | |
1cb8c72c | 144 | %doc CHANGES.rst LICENSE.rst README.rst |
63775cd9 | 145 | %{py3_sitescriptdir}/%{module} |
bd8c7cd4 | 146 | %{py3_sitescriptdir}/Jinja2-%{version}-py*.egg-info |
63775cd9 AF |
147 | %endif |
148 | ||
bb2732e3 | 149 | %if %{with doc} |
63775cd9 AF |
150 | %files apidoc |
151 | %defattr(644,root,root,755) | |
6fb399b6 | 152 | %doc docs/_build/html/{_static,*.html,*.js} |
bb2732e3 | 153 | %endif |