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