]>
Commit | Line | Data |
---|---|---|
bd8c7cd4 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
4 | %bcond_without python2 # Python 2.x modules | |
5 | %bcond_without python3 # Python 3.x modules | |
22da3d42 ER |
6 | |
7 | %define module jinja2 | |
bd8c7cd4 JB |
8 | Summary: Jinja2 Template engine for Python 2.x |
9 | Summary(pl.UTF-8): Silnik szablonów Jinja2 dla Pythona 2.x | |
32bc8461 | 10 | Name: python-%{module} |
7b9c0608 | 11 | Version: 2.7.3 |
4958ba04 | 12 | Release: 5 |
32bc8461 MK |
13 | License: BSD |
14 | Group: Development/Languages/Python | |
716e4027 | 15 | Source0: https://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz |
7b9c0608 | 16 | # Source0-md5: b9dffd2f3b43d673802fe857c8445b1a |
716e4027 | 17 | Patch0: %{name}-docs.patch |
63775cd9 | 18 | URL: http://jinja.pocoo.org/ |
196bf8af | 19 | BuildRequires: rpm-pythonprov |
63775cd9 | 20 | %if %{with python2} |
32bc8461 | 21 | BuildRequires: python-devel |
de2c695c | 22 | BuildRequires: python-setuptools |
63775cd9 AF |
23 | %endif |
24 | %if %{with python3} | |
25 | BuildRequires: python3-devel | |
f1a9449f | 26 | BuildRequires: python3-setuptools |
196bf8af | 27 | BuildRequires: python3-modules |
63775cd9 | 28 | %endif |
bb2732e3 AF |
29 | %if %{with doc} |
30 | BuildRequires: sphinx-pdg | |
31 | %endif | |
36ef4e1f | 32 | Requires: python-markupsafe |
22da3d42 ER |
33 | Requires: python-modules |
34 | BuildArch: noarch | |
32bc8461 MK |
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 | |
bd8c7cd4 | 39 | in pure Python. Provides a Django inspired non-XML syntax but supports |
32bc8461 MK |
40 | inline expressions and an optional sandboxed environment. |
41 | ||
32bc8461 | 42 | %description -l pl.UTF-8 |
bd8c7cd4 JB |
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 | |
32bc8461 MK |
46 | ograniczonym środowisku. |
47 | ||
63775cd9 | 48 | %package -n python3-%{module} |
bd8c7cd4 | 49 | Summary: Template engine Jinja2 for Python 3.x |
22da3d42 ER |
50 | Summary(pl.UTF-8): Silnik szablonów Jinja2 dla Pythona 3.x |
51 | Group: Development/Languages/Python | |
36ef4e1f | 52 | Requires: python3-markupsafe |
22da3d42 | 53 | Requires: python3-modules |
63775cd9 | 54 | |
5742e286 | 55 | %description -n python3-%{module} |
63775cd9 | 56 | A small but fast and easy to use stand-alone template engine written |
bd8c7cd4 | 57 | in pure Python. Provides a Django inspired non-XML syntax but supports |
63775cd9 AF |
58 | inline expressions and an optional sandboxed environment. |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
bd8c7cd4 JB |
61 | Mały ale szybki i łatwy w użyciu samodzielny silnik szablonów napisany |
62 | w czystym Pythonie. Udostępnia podobne do Django, o odmiennej od XML-a | |
63 | składni i kompilowane do kodu Pythona szablony w opcjonalnie | |
63775cd9 AF |
64 | ograniczonym środowisku. |
65 | ||
66 | %package apidoc | |
67 | Summary: Jinja2 template engine API documentation | |
bd8c7cd4 | 68 | Summary(pl.UTF-8): Dokumentacja API silnika szablonów Jinja2 |
22da3d42 | 69 | Group: Development/Languages/Python |
63775cd9 AF |
70 | |
71 | %description apidoc | |
bd8c7cd4 JB |
72 | API documentation for Jinja2 template engine. |
73 | ||
74 | %description apidoc -l pl.UTF-8 | |
75 | Dokumentacja API silnika szablonów Jinja2. | |
63775cd9 | 76 | |
32bc8461 MK |
77 | %prep |
78 | %setup -q -n Jinja2-%{version} | |
716e4027 | 79 | %patch0 -p1 |
32bc8461 MK |
80 | |
81 | %build | |
63775cd9 | 82 | %if %{with python2} |
d831097c | 83 | %py_build |
63775cd9 AF |
84 | %endif |
85 | %if %{with python3} | |
d831097c | 86 | %py3_build |
63775cd9 AF |
87 | %endif |
88 | ||
bb2732e3 AF |
89 | %if %{with doc} |
90 | cd docs | |
8fb54c68 | 91 | %{__make} -j1 html |
bb2732e3 AF |
92 | rm -rf _build/html/_sources |
93 | %endif | |
32bc8461 MK |
94 | |
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
63775cd9 | 98 | %if %{with python2} |
d831097c | 99 | %py_install |
32bc8461 MK |
100 | |
101 | %py_postclean | |
63775cd9 AF |
102 | %endif |
103 | ||
104 | %if %{with python3} | |
d831097c | 105 | %py3_install |
63775cd9 | 106 | %endif |
32bc8461 MK |
107 | |
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
63775cd9 | 111 | %if %{with python2} |
32bc8461 MK |
112 | %files |
113 | %defattr(644,root,root,755) | |
22da3d42 | 114 | %doc AUTHORS CHANGES LICENSE |
63775cd9 | 115 | %{py_sitescriptdir}/%{module} |
bd8c7cd4 | 116 | %{py_sitescriptdir}/Jinja2-%{version}-py*.egg-info |
63775cd9 AF |
117 | %endif |
118 | ||
119 | %if %{with python3} | |
120 | %files -n python3-%{module} | |
121 | %defattr(644,root,root,755) | |
22da3d42 | 122 | %doc AUTHORS CHANGES LICENSE |
63775cd9 | 123 | %{py3_sitescriptdir}/%{module} |
bd8c7cd4 | 124 | %{py3_sitescriptdir}/Jinja2-%{version}-py*.egg-info |
63775cd9 AF |
125 | %endif |
126 | ||
bb2732e3 | 127 | %if %{with doc} |
63775cd9 AF |
128 | %files apidoc |
129 | %defattr(644,root,root,755) | |
22da3d42 | 130 | %doc docs/_build/html/* |
bb2732e3 | 131 | %endif |