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