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