]>
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 | |
b1dbdc2a | 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} |
7c90b45b JB |
12 | Version: 0.11.15 |
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 | |
21 | # Source0-md5: 9cb2ba56c694dbd5863ed1b13ce478c2 | |
22 | Patch0: %{name}-py3.patch | |
c6a9fbf4 | 23 | URL: http://werkzeug.pocoo.org/ |
9fb4e136 | 24 | %if %{with python2} |
7c90b45b JB |
25 | BuildRequires: python-devel >= 1:2.6 |
26 | BuildRequires: python-modules >= 1:2.6 | |
27 | BuildRequires: python-setuptools | |
9fb4e136 MK |
28 | %endif |
29 | %if %{with python3} | |
7c90b45b JB |
30 | BuildRequires: python3-devel >= 1:3.3 |
31 | BuildRequires: python3-modules >= 1:3.3 | |
32 | BuildRequires: python3-setuptools | |
33 | %endif | |
34 | BuildRequires: rpm-pythonprov | |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
36 | %if %{with doc} | |
37 | BuildRequires: sphinx-pdg | |
9fb4e136 | 38 | %endif |
7c90b45b | 39 | Requires: python-modules >= 1:2.6 |
c6a9fbf4 | 40 | BuildArch: noarch |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
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. | |
50 | ||
7c90b45b JB |
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ść. | |
59 | ||
9fb4e136 MK |
60 | %package -n python3-%{module} |
61 | Summary: The Swiss Army knife of Python web development | |
7c90b45b | 62 | Summary(pl.UTF-8): Scyzoryk szwajcarski programisty aplikacji WWW |
9fb4e136 | 63 | Group: Libraries/Python |
7c90b45b | 64 | Requires: python3-modules >= 1:3.3 |
9fb4e136 MK |
65 | |
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. | |
73 | ||
7c90b45b JB |
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ść. | |
82 | ||
83 | %package apidocs | |
84 | Summary: Documentation for Python Werkzeug package | |
85 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Werkzeug | |
86 | Group: Documentation | |
87 | ||
88 | %description apidocs | |
89 | Documentation for Python Werkzeug package. | |
90 | ||
91 | %description apidocs -l pl.UTF-8 | |
92 | Dokumentacja do pakietu Pythona Werkzeug. | |
93 | ||
c6a9fbf4 | 94 | %prep |
fdb1d6ee | 95 | %setup -q -n werkzeug-%{version} |
7c90b45b | 96 | %patch0 -p1 |
c6a9fbf4 | 97 | |
98 | %build | |
9fb4e136 | 99 | %if %{with python2} |
5db35e26 | 100 | %py_build %{?with_tests:test} |
9fb4e136 MK |
101 | %endif |
102 | ||
103 | %if %{with python3} | |
5db35e26 | 104 | %py3_build %{?with_tests:test} |
9fb4e136 | 105 | %endif |
c6a9fbf4 | 106 | |
7c90b45b JB |
107 | %if %{with doc} |
108 | PYTHONPATH=$(pwd) \ | |
109 | %{__make} -C docs html | |
110 | %endif | |
111 | ||
c6a9fbf4 | 112 | %install |
113 | rm -rf $RPM_BUILD_ROOT | |
9fb4e136 | 114 | %if %{with python2} |
5db35e26 | 115 | %py_install |
9fb4e136 | 116 | %py_postclean |
2f8691a4 ER |
117 | |
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}|' | |
9fb4e136 MK |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
5db35e26 | 125 | %py3_install |
9fb4e136 | 126 | |
9fb4e136 MK |
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' \ | |
2f8691a4 | 130 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' |
9fb4e136 | 131 | %endif |
c6a9fbf4 | 132 | |
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
9fb4e136 | 136 | %if %{with python2} |
c6a9fbf4 | 137 | %files |
138 | %defattr(644,root,root,755) | |
7c90b45b | 139 | %doc AUTHORS CHANGES LICENSE README.rst |
c6a9fbf4 | 140 | %{py_sitescriptdir}/werkzeug |
b1dbdc2a | 141 | %{py_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
2f8691a4 | 142 | %{_examplesdir}/python-%{module}-%{version} |
9fb4e136 MK |
143 | %endif |
144 | ||
145 | %if %{with python3} | |
146 | %files -n python3-%{module} | |
147 | %defattr(644,root,root,755) | |
7c90b45b JB |
148 | %doc AUTHORS CHANGES LICENSE README.rst |
149 | %{py3_sitescriptdir}/werkzeug | |
b1dbdc2a | 150 | %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
9fb4e136 MK |
151 | %{_examplesdir}/python3-%{module}-%{version} |
152 | %endif | |
7c90b45b JB |
153 | |
154 | %if %{with doc} | |
155 | %files apidocs | |
156 | %defattr(644,root,root,755) | |
157 | %doc docs/_build/html/{_images,_static,contrib,deployment,*.html,*.js} | |
158 | %endif |