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