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
8 %define module werkzeug
9 Summary: The Swiss Army knife of Python web development
10 Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW
11 Name: python-%{module}
15 Group: Development/Languages/Python
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
21 # Source0-md5: 9cb2ba56c694dbd5863ed1b13ce478c2
22 Patch0: %{name}-py3.patch
23 URL: http://werkzeug.pocoo.org/
25 BuildRequires: python-devel >= 1:2.6
26 BuildRequires: python-modules >= 1:2.6
27 BuildRequires: python-setuptools
30 BuildRequires: python3-devel >= 1:3.3
31 BuildRequires: python3-modules >= 1:3.3
32 BuildRequires: python3-setuptools
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
37 BuildRequires: sphinx-pdg
39 Requires: python-modules >= 1:2.6
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Werkzeug started as simple collection of various utilities for WSGI
45 applications and has become one of the most advanced WSGI utility
46 modules. It includes a powerful debugger, full featured request and
47 response objects, HTTP utilities to handle entity tags, cache control
48 headers, HTTP dates, cookie handling, file uploads, a powerful URL
49 routing system and a bunch of community contributed addon modules.
51 %description -l pl.UTF-8
52 Werkzeug początkowo był prostym zbiorem różnych narzędzi dla aplikacji
53 WSGI, a stał się jednym z najbardziej zaawansowanych modułów
54 narzędziowych WSGI. Zawiera potężny debugger, obiekty żądania i
55 odpowiedzi z pełną funkcjonalnością, narzędzia HTTP do obsługi
56 znaczników encji, nagłówki sterujące buforowaniem, daty HTTP, obsługę
57 ciasteczek, przesyłanie plików, potężny system trasowania URL oraz
58 wiele dodatkowych modułów udostępnionych przez społeczność.
60 %package -n python3-%{module}
61 Summary: The Swiss Army knife of Python web development
62 Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW
63 Group: Libraries/Python
64 Requires: python3-modules >= 1:3.3
66 %description -n python3-%{module}
67 Werkzeug started as simple collection of various utilities for WSGI
68 applications and has become one of the most advanced WSGI utility
69 modules. It includes a powerful debugger, full featured request and
70 response objects, HTTP utilities to handle entity tags, cache control
71 headers, HTTP dates, cookie handling, file uploads, a powerful URL
72 routing system and a bunch of community contributed addon modules.
74 %description -n python3-%{module} -l pl.UTF-8
75 Werkzeug początkowo był prostym zbiorem różnych narzędzi dla aplikacji
76 WSGI, a stał się jednym z najbardziej zaawansowanych modułów
77 narzędziowych WSGI. Zawiera potężny debugger, obiekty żądania i
78 odpowiedzi z pełną funkcjonalnością, narzędzia HTTP do obsługi
79 znaczników encji, nagłówki sterujące buforowaniem, daty HTTP, obsługę
80 ciasteczek, przesyłanie plików, potężny system trasowania URL oraz
81 wiele dodatkowych modułów udostępnionych przez społeczność.
84 Summary: Documentation for Python Werkzeug package
85 Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Werkzeug
89 Documentation for Python Werkzeug package.
91 %description apidocs -l pl.UTF-8
92 Dokumentacja do pakietu Pythona Werkzeug.
95 %setup -q -n werkzeug-%{version}
100 %py_build %{?with_tests:test}
104 %py3_build %{?with_tests:test}
109 %{__make} -C docs html
113 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
119 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
120 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
121 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
127 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
128 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
129 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
130 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
134 rm -rf $RPM_BUILD_ROOT
138 %defattr(644,root,root,755)
139 %doc AUTHORS CHANGES LICENSE README.rst
140 %{py_sitescriptdir}/werkzeug
141 %{py_sitescriptdir}/Werkzeug-%{version}-py*.egg-info
142 %{_examplesdir}/python-%{module}-%{version}
146 %files -n python3-%{module}
147 %defattr(644,root,root,755)
148 %doc AUTHORS CHANGES LICENSE README.rst
149 %{py3_sitescriptdir}/werkzeug
150 %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info
151 %{_examplesdir}/python3-%{module}-%{version}
156 %defattr(644,root,root,755)
157 %doc docs/_build/html/{_images,_static,contrib,deployment,*.html,*.js}