]>
Commit | Line | Data |
---|---|---|
2f8691a4 | 1 | # |
7c90b45b JB |
2 | # Conditional build: |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # test action | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
c6a9fbf4 | 7 | |
995eef0a | 8 | %define module werkzeug |
c6a9fbf4 | 9 | Summary: The Swiss Army knife of Python web development |
7c90b45b | 10 | Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW |
c6a9fbf4 | 11 | Name: python-%{module} |
3188be72 AM |
12 | Version: 0.16.0 |
13 | Release: 1 | |
c6a9fbf4 | 14 | License: BSD |
15 | Group: Development/Languages/Python | |
7c90b45b JB |
16 | # pypi release misses docs/_themes directory |
17 | ##Source0Download: https://pypi.python.org/simple/Werkzeug | |
18 | #Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz | |
19 | #Source0Download: https://github.com/pallets/werkzeug/releases | |
20 | Source0: https://github.com/pallets/werkzeug/archive/%{version}/werkzeug-%{version}.tar.gz | |
3188be72 | 21 | # Source0-md5: e2d3061005cc442d80a118b42f8f3e11 |
c6a9fbf4 | 22 | URL: http://werkzeug.pocoo.org/ |
9fb4e136 | 23 | %if %{with python2} |
7c90b45b JB |
24 | BuildRequires: python-devel >= 1:2.6 |
25 | BuildRequires: python-modules >= 1:2.6 | |
26 | BuildRequires: python-setuptools | |
7800109b JB |
27 | %if %{with tests} |
28 | BuildRequires: python-greenlet | |
29 | BuildRequires: python-hypothesis | |
30 | # optional | |
31 | #BuildRequires: python-memcached | |
32 | BuildRequires: python-pyOpenSSL | |
33 | BuildRequires: python-pytest | |
34 | # optional | |
35 | #BuildRequires: python-pytest-xprocess | |
36 | # optional | |
37 | #BuildRequires: python-redis | |
38 | BuildRequires: python-requests | |
39 | # optional | |
40 | #BuildRequires: python-watchdog | |
41 | %endif | |
9fb4e136 MK |
42 | %endif |
43 | %if %{with python3} | |
7c90b45b JB |
44 | BuildRequires: python3-devel >= 1:3.3 |
45 | BuildRequires: python3-modules >= 1:3.3 | |
46 | BuildRequires: python3-setuptools | |
7800109b JB |
47 | %if %{with tests} |
48 | BuildRequires: python3-greenlet | |
49 | BuildRequires: python3-hypothesis | |
50 | # optional | |
51 | #BuildRequires: python3-memcached | |
52 | BuildRequires: python3-pyOpenSSL | |
53 | BuildRequires: python3-pytest | |
54 | # optional | |
55 | #BuildRequires: python3-pytest-xprocess | |
56 | # optional | |
57 | #BuildRequires: python3-redis | |
58 | BuildRequires: python3-requests | |
59 | # optional | |
60 | #BuildRequires: python3-watchdog | |
61 | %endif | |
7c90b45b JB |
62 | %endif |
63 | BuildRequires: rpm-pythonprov | |
64 | BuildRequires: rpmbuild(macros) >= 1.714 | |
65 | %if %{with doc} | |
3188be72 | 66 | BuildRequires: python3-sphinx_issues |
7c90b45b | 67 | BuildRequires: sphinx-pdg |
9fb4e136 | 68 | %endif |
7c90b45b | 69 | Requires: python-modules >= 1:2.6 |
c6a9fbf4 | 70 | BuildArch: noarch |
71 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
72 | ||
73 | %description | |
74 | Werkzeug started as simple collection of various utilities for WSGI | |
75 | applications and has become one of the most advanced WSGI utility | |
76 | modules. It includes a powerful debugger, full featured request and | |
77 | response objects, HTTP utilities to handle entity tags, cache control | |
78 | headers, HTTP dates, cookie handling, file uploads, a powerful URL | |
79 | routing system and a bunch of community contributed addon modules. | |
80 | ||
7c90b45b JB |
81 | %description -l pl.UTF-8 |
82 | Werkzeug początkowo był prostym zbiorem różnych narzędzi dla aplikacji | |
83 | WSGI, a stał się jednym z najbardziej zaawansowanych modułów | |
84 | narzędziowych WSGI. Zawiera potężny debugger, obiekty żądania i | |
85 | odpowiedzi z pełną funkcjonalnością, narzędzia HTTP do obsługi | |
86 | znaczników encji, nagłówki sterujące buforowaniem, daty HTTP, obsługę | |
87 | ciasteczek, przesyłanie plików, potężny system trasowania URL oraz | |
88 | wiele dodatkowych modułów udostępnionych przez społeczność. | |
89 | ||
9fb4e136 MK |
90 | %package -n python3-%{module} |
91 | Summary: The Swiss Army knife of Python web development | |
7c90b45b | 92 | Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW |
9fb4e136 | 93 | Group: Libraries/Python |
7c90b45b | 94 | Requires: python3-modules >= 1:3.3 |
9fb4e136 MK |
95 | |
96 | %description -n python3-%{module} | |
97 | Werkzeug started as simple collection of various utilities for WSGI | |
98 | applications and has become one of the most advanced WSGI utility | |
99 | modules. It includes a powerful debugger, full featured request and | |
100 | response objects, HTTP utilities to handle entity tags, cache control | |
101 | headers, HTTP dates, cookie handling, file uploads, a powerful URL | |
102 | routing system and a bunch of community contributed addon modules. | |
103 | ||
7c90b45b JB |
104 | %description -n python3-%{module} -l pl.UTF-8 |
105 | Werkzeug początkowo był prostym zbiorem różnych narzędzi dla aplikacji | |
106 | WSGI, a stał się jednym z najbardziej zaawansowanych modułów | |
107 | narzędziowych WSGI. Zawiera potężny debugger, obiekty żądania i | |
108 | odpowiedzi z pełną funkcjonalnością, narzędzia HTTP do obsługi | |
109 | znaczników encji, nagłówki sterujące buforowaniem, daty HTTP, obsługę | |
110 | ciasteczek, przesyłanie plików, potężny system trasowania URL oraz | |
111 | wiele dodatkowych modułów udostępnionych przez społeczność. | |
112 | ||
113 | %package apidocs | |
114 | Summary: Documentation for Python Werkzeug package | |
115 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Werkzeug | |
116 | Group: Documentation | |
117 | ||
118 | %description apidocs | |
119 | Documentation for Python Werkzeug package. | |
120 | ||
121 | %description apidocs -l pl.UTF-8 | |
122 | Dokumentacja do pakietu Pythona Werkzeug. | |
123 | ||
c6a9fbf4 | 124 | %prep |
fdb1d6ee | 125 | %setup -q -n werkzeug-%{version} |
c6a9fbf4 | 126 | |
127 | %build | |
9fb4e136 | 128 | %if %{with python2} |
5db35e26 | 129 | %py_build %{?with_tests:test} |
9fb4e136 MK |
130 | %endif |
131 | ||
132 | %if %{with python3} | |
5db35e26 | 133 | %py3_build %{?with_tests:test} |
9fb4e136 | 134 | %endif |
c6a9fbf4 | 135 | |
7c90b45b JB |
136 | %if %{with doc} |
137 | PYTHONPATH=$(pwd) \ | |
138 | %{__make} -C docs html | |
139 | %endif | |
140 | ||
c6a9fbf4 | 141 | %install |
142 | rm -rf $RPM_BUILD_ROOT | |
9fb4e136 | 143 | %if %{with python2} |
5db35e26 | 144 | %py_install |
9fb4e136 | 145 | %py_postclean |
2f8691a4 ER |
146 | |
147 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
148 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
149 | find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \ | |
150 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
9fb4e136 MK |
151 | %endif |
152 | ||
153 | %if %{with python3} | |
5db35e26 | 154 | %py3_install |
9fb4e136 | 155 | |
9fb4e136 MK |
156 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
157 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
158 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
2f8691a4 | 159 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' |
9fb4e136 | 160 | %endif |
c6a9fbf4 | 161 | |
162 | %clean | |
163 | rm -rf $RPM_BUILD_ROOT | |
164 | ||
9fb4e136 | 165 | %if %{with python2} |
c6a9fbf4 | 166 | %files |
167 | %defattr(644,root,root,755) | |
3188be72 | 168 | %doc CHANGES.rst LICENSE.rst README.rst |
c6a9fbf4 | 169 | %{py_sitescriptdir}/werkzeug |
b1dbdc2a | 170 | %{py_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
2f8691a4 | 171 | %{_examplesdir}/python-%{module}-%{version} |
9fb4e136 MK |
172 | %endif |
173 | ||
174 | %if %{with python3} | |
175 | %files -n python3-%{module} | |
176 | %defattr(644,root,root,755) | |
3188be72 | 177 | %doc CHANGES.rst LICENSE.rst README.rst |
7c90b45b | 178 | %{py3_sitescriptdir}/werkzeug |
b1dbdc2a | 179 | %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
9fb4e136 MK |
180 | %{_examplesdir}/python3-%{module}-%{version} |
181 | %endif | |
7c90b45b JB |
182 | |
183 | %if %{with doc} | |
184 | %files apidocs | |
185 | %defattr(644,root,root,755) | |
186 | %doc docs/_build/html/{_images,_static,contrib,deployment,*.html,*.js} | |
187 | %endif |