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