]>
Commit | Line | Data |
---|---|---|
2f8691a4 | 1 | # |
7c90b45b JB |
2 | # Conditional build: |
3 | %bcond_without doc # Sphinx documentation | |
faf6ada2 | 4 | %bcond_without tests # test action |
c6a9fbf4 | 5 | |
995eef0a | 6 | %define module werkzeug |
c6a9fbf4 | 7 | Summary: The Swiss Army knife of Python web development |
7c90b45b | 8 | Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW |
b1fcb247 | 9 | Name: python3-%{module} |
42a506a8 | 10 | Version: 2.2.3 |
8cac1ad5 | 11 | Release: 1 |
c6a9fbf4 | 12 | License: BSD |
13 | Group: Development/Languages/Python | |
7c90b45b | 14 | # pypi release misses docs/_themes directory |
42a506a8 | 15 | ##Source0Download: https://pypi.org/simple/Werkzeug |
7c90b45b JB |
16 | #Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz |
17 | #Source0Download: https://github.com/pallets/werkzeug/releases | |
18 | Source0: https://github.com/pallets/werkzeug/archive/%{version}/werkzeug-%{version}.tar.gz | |
42a506a8 | 19 | # Source0-md5: 3da84b7479521f8e8c2003cc4006b439 |
faf6ada2 | 20 | URL: https://werkzeug.palletsprojects.com/ |
42a506a8 JB |
21 | BuildRequires: python3-devel >= 1:3.7 |
22 | BuildRequires: python3-modules >= 1:3.7 | |
7c90b45b | 23 | BuildRequires: python3-setuptools |
7800109b | 24 | %if %{with tests} |
faf6ada2 | 25 | BuildRequires: python3-cryptography |
42a506a8 | 26 | BuildRequires: python3-ephemeral_port_reserve |
7800109b | 27 | BuildRequires: python3-greenlet |
42a506a8 | 28 | BuildRequires: python3-markupsafe >= 2.1.1 |
7800109b JB |
29 | BuildRequires: python3-pyOpenSSL |
30 | BuildRequires: python3-pytest | |
faf6ada2 | 31 | BuildRequires: python3-pytest-timeout |
42a506a8 | 32 | BuildRequires: python3-pytest-xprocess |
7800109b JB |
33 | BuildRequires: python3-requests |
34 | # optional | |
35 | #BuildRequires: python3-watchdog | |
36 | %endif | |
7c90b45b JB |
37 | BuildRequires: rpm-pythonprov |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | %if %{with doc} | |
faf6ada2 | 40 | BuildRequires: python3-pallets-sphinx-themes |
3188be72 | 41 | BuildRequires: python3-sphinx_issues |
faf6ada2 JB |
42 | BuildRequires: python3-sphinxcontrib-log-cabinet |
43 | BuildRequires: sphinx-pdg-3 | |
9fb4e136 | 44 | %endif |
42a506a8 | 45 | Requires: python3-modules >= 1:3.7 |
c6a9fbf4 | 46 | BuildArch: noarch |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | Werkzeug started as simple collection of various utilities for WSGI | |
51 | applications and has become one of the most advanced WSGI utility | |
52 | modules. It includes a powerful debugger, full featured request and | |
53 | response objects, HTTP utilities to handle entity tags, cache control | |
54 | headers, HTTP dates, cookie handling, file uploads, a powerful URL | |
55 | routing system and a bunch of community contributed addon modules. | |
56 | ||
7c90b45b JB |
57 | %description -l pl.UTF-8 |
58 | Werkzeug początkowo był prostym zbiorem różnych narzędzi dla aplikacji | |
59 | WSGI, a stał się jednym z najbardziej zaawansowanych modułów | |
60 | narzędziowych WSGI. Zawiera potężny debugger, obiekty żądania i | |
61 | odpowiedzi z pełną funkcjonalnością, narzędzia HTTP do obsługi | |
62 | znaczników encji, nagłówki sterujące buforowaniem, daty HTTP, obsługę | |
63 | ciasteczek, przesyłanie plików, potężny system trasowania URL oraz | |
64 | wiele dodatkowych modułów udostępnionych przez społeczność. | |
65 | ||
7c90b45b JB |
66 | %package apidocs |
67 | Summary: Documentation for Python Werkzeug package | |
68 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Werkzeug | |
69 | Group: Documentation | |
70 | ||
71 | %description apidocs | |
72 | Documentation for Python Werkzeug package. | |
73 | ||
74 | %description apidocs -l pl.UTF-8 | |
75 | Dokumentacja do pakietu Pythona Werkzeug. | |
76 | ||
c6a9fbf4 | 77 | %prep |
fdb1d6ee | 78 | %setup -q -n werkzeug-%{version} |
c6a9fbf4 | 79 | |
80 | %build | |
faf6ada2 JB |
81 | %py3_build |
82 | ||
83 | %if %{with tests} | |
84 | LC_ALL=C.UTF-8 \ | |
85 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
42a506a8 | 86 | PYTEST_PLUGINS=pytest_timeout,xprocess.pytest_xprocess \ |
faf6ada2 | 87 | PYTHONPATH=$(pwd)/src \ |
42a506a8 JB |
88 | %{__python3} -m pytest tests -m 'not dev_server' -k 'not test_exclude_patterns' |
89 | # dev_server tests fail with connection refused(?) | |
90 | # test_exclude_patterns seems to fail with sys.prefix == sys.base_prefix (?) | |
faf6ada2 | 91 | %endif |
c6a9fbf4 | 92 | |
7c90b45b | 93 | %if %{with doc} |
faf6ada2 JB |
94 | PYTHONPATH=$(pwd)/src \ |
95 | %{__make} -C docs html \ | |
96 | SPHINXBUILD=sphinx-build-3 | |
7c90b45b JB |
97 | %endif |
98 | ||
c6a9fbf4 | 99 | %install |
100 | rm -rf $RPM_BUILD_ROOT | |
9fb4e136 | 101 | |
5db35e26 | 102 | %py3_install |
9fb4e136 | 103 | |
9fb4e136 MK |
104 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
105 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
106 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
2f8691a4 | 107 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' |
c6a9fbf4 | 108 | |
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %files | |
113 | %defattr(644,root,root,755) | |
3188be72 | 114 | %doc CHANGES.rst LICENSE.rst README.rst |
7c90b45b | 115 | %{py3_sitescriptdir}/werkzeug |
b1dbdc2a | 116 | %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
9fb4e136 | 117 | %{_examplesdir}/python3-%{module}-%{version} |
7c90b45b JB |
118 | |
119 | %if %{with doc} | |
120 | %files apidocs | |
121 | %defattr(644,root,root,755) | |
faf6ada2 | 122 | %doc docs/_build/html/{_images,_static,deployment,middleware,*.html,*.js} |
7c90b45b | 123 | %endif |