]>
Commit | Line | Data |
---|---|---|
9fb4e136 | 1 | # TODO: rename to python-werkzeug |
c6a9fbf4 | 2 | # |
3 | # Conditional build: | |
9fb4e136 MK |
4 | # %bcond_without doc # don't build doc |
5 | %bcond_with tests # do not perform "make test" | |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
c6a9fbf4 | 8 | |
b1dbdc2a | 9 | %define module werkzeug |
c6a9fbf4 | 10 | Summary: The Swiss Army knife of Python web development |
c6a9fbf4 | 11 | Name: python-%{module} |
fdb1d6ee MK |
12 | Version: 0.11.10 |
13 | Release: 1 | |
c6a9fbf4 | 14 | License: BSD |
15 | Group: Development/Languages/Python | |
fdb1d6ee MK |
16 | # Source0: http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz |
17 | Source0: https://github.com/pallets/werkzeug/archive/%{version}.tar.gz | |
18 | # Source0-md5: 5010591f97c36722027bd23ade0029e3 | |
c6a9fbf4 | 19 | URL: http://werkzeug.pocoo.org/ |
9fb4e136 | 20 | %if %{with python2} |
c6a9fbf4 | 21 | BuildRequires: python-distribute |
22 | BuildRequires: rpm-pythonprov | |
1c603c6d | 23 | BuildRequires: rpmbuild(macros) >= 1.710 |
b0214460 | 24 | Requires: python-modules |
9fb4e136 MK |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-distribute | |
29 | BuildRequires: python3-modules | |
30 | Requires: python3-modules | |
31 | %endif | |
32 | ||
33 | ||
c6a9fbf4 | 34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | Werkzeug started as simple collection of various utilities for WSGI | |
39 | applications and has become one of the most advanced WSGI utility | |
40 | modules. It includes a powerful debugger, full featured request and | |
41 | response objects, HTTP utilities to handle entity tags, cache control | |
42 | headers, HTTP dates, cookie handling, file uploads, a powerful URL | |
43 | routing system and a bunch of community contributed addon modules. | |
44 | ||
9fb4e136 MK |
45 | %package -n python3-%{module} |
46 | Summary: The Swiss Army knife of Python web development | |
47 | Summary(pl.UTF-8): Zbiór narzędzi dla rozwouju aplikacji sieciowych dla Pythona | |
48 | Group: Libraries/Python | |
49 | ||
50 | %description -n python3-%{module} | |
51 | Werkzeug started as simple collection of various utilities for WSGI | |
52 | applications and has become one of the most advanced WSGI utility | |
53 | modules. It includes a powerful debugger, full featured request and | |
54 | response objects, HTTP utilities to handle entity tags, cache control | |
55 | headers, HTTP dates, cookie handling, file uploads, a powerful URL | |
56 | routing system and a bunch of community contributed addon modules. | |
57 | ||
58 | # %description -n python3-%{module} -l pl.UTF-8 | |
59 | ||
c6a9fbf4 | 60 | %prep |
fdb1d6ee | 61 | %setup -q -n werkzeug-%{version} |
c6a9fbf4 | 62 | |
63 | %build | |
9fb4e136 | 64 | %if %{with python2} |
5db35e26 | 65 | %py_build %{?with_tests:test} |
9fb4e136 MK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
5db35e26 | 69 | %py3_build %{?with_tests:test} |
9fb4e136 | 70 | %endif |
c6a9fbf4 | 71 | |
c6a9fbf4 | 72 | |
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
c6a9fbf4 | 75 | |
9fb4e136 | 76 | %if %{with python2} |
5db35e26 | 77 | %py_install |
9fb4e136 MK |
78 | |
79 | %py_postclean | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
5db35e26 | 83 | %py3_install |
9fb4e136 MK |
84 | %endif |
85 | ||
86 | %if %{with python2} | |
c6a9fbf4 | 87 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
88 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
9fb4e136 MK |
89 | %endif |
90 | %if %{with python3} | |
91 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
92 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
93 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
94 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
95 | %endif | |
c6a9fbf4 | 96 | %py_postclean |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
9fb4e136 | 101 | %if %{with python2} |
c6a9fbf4 | 102 | %files |
103 | %defattr(644,root,root,755) | |
104 | %doc AUTHORS CHANGES | |
105 | %{py_sitescriptdir}/werkzeug | |
106 | %if "%{py_ver}" > "2.4" | |
b1dbdc2a | 107 | %{py_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
c6a9fbf4 | 108 | %endif |
109 | %{_examplesdir}/%{name}-%{version} | |
9fb4e136 MK |
110 | %endif |
111 | ||
112 | %if %{with python3} | |
113 | %files -n python3-%{module} | |
114 | %defattr(644,root,root,755) | |
115 | %doc AUTHORS CHANGES LICENSE | |
b1dbdc2a MK |
116 | %{py3_sitescriptdir}/%{module} |
117 | %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info | |
9fb4e136 MK |
118 | %{_examplesdir}/python3-%{module}-%{version} |
119 | %endif |