]>
Commit | Line | Data |
---|---|---|
c6a9fbf4 | 1 | # Conditional build: |
2f8691a4 ER |
2 | # |
3 | %bcond_with doc # don't build doc | |
9fb4e136 MK |
4 | %bcond_with tests # do not perform "make test" |
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 |
c6a9fbf4 | 10 | Name: python-%{module} |
fdb1d6ee | 11 | Version: 0.11.10 |
640e4e52 | 12 | Release: 2 |
c6a9fbf4 | 13 | License: BSD |
14 | Group: Development/Languages/Python | |
fdb1d6ee MK |
15 | # Source0: http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz |
16 | Source0: https://github.com/pallets/werkzeug/archive/%{version}.tar.gz | |
17 | # Source0-md5: 5010591f97c36722027bd23ade0029e3 | |
c6a9fbf4 | 18 | URL: http://werkzeug.pocoo.org/ |
9fb4e136 | 19 | %if %{with python2} |
c6a9fbf4 | 20 | BuildRequires: python-distribute |
21 | BuildRequires: rpm-pythonprov | |
1c603c6d | 22 | BuildRequires: rpmbuild(macros) >= 1.710 |
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 | |
9fb4e136 | 29 | %endif |
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 | ||
c6a9fbf4 | 55 | %prep |
fdb1d6ee | 56 | %setup -q -n werkzeug-%{version} |
c6a9fbf4 | 57 | |
58 | %build | |
9fb4e136 | 59 | %if %{with python2} |
5db35e26 | 60 | %py_build %{?with_tests:test} |
9fb4e136 MK |
61 | %endif |
62 | ||
63 | %if %{with python3} | |
5db35e26 | 64 | %py3_build %{?with_tests:test} |
9fb4e136 | 65 | %endif |
c6a9fbf4 | 66 | |
c6a9fbf4 | 67 | %install |
68 | rm -rf $RPM_BUILD_ROOT | |
9fb4e136 | 69 | %if %{with python2} |
5db35e26 | 70 | %py_install |
9fb4e136 | 71 | %py_postclean |
2f8691a4 ER |
72 | |
73 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
74 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
75 | find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \ | |
76 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
9fb4e136 MK |
77 | %endif |
78 | ||
79 | %if %{with python3} | |
5db35e26 | 80 | %py3_install |
9fb4e136 | 81 | |
9fb4e136 MK |
82 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
83 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
84 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
2f8691a4 | 85 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' |
9fb4e136 | 86 | %endif |
c6a9fbf4 | 87 | |
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
9fb4e136 | 91 | %if %{with python2} |
c6a9fbf4 | 92 | %files |
93 | %defattr(644,root,root,755) | |
94 | %doc AUTHORS CHANGES | |
95 | %{py_sitescriptdir}/werkzeug | |
b1dbdc2a | 96 | %{py_sitescriptdir}/Werkzeug-%{version}-py*.egg-info |
2f8691a4 | 97 | %{_examplesdir}/python-%{module}-%{version} |
9fb4e136 MK |
98 | %endif |
99 | ||
100 | %if %{with python3} | |
101 | %files -n python3-%{module} | |
102 | %defattr(644,root,root,755) | |
103 | %doc AUTHORS CHANGES LICENSE | |
b1dbdc2a MK |
104 | %{py3_sitescriptdir}/%{module} |
105 | %{py3_sitescriptdir}/Werkzeug-%{version}-py*.egg-info | |
9fb4e136 MK |
106 | %{_examplesdir}/python3-%{module}-%{version} |
107 | %endif |