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