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