]>
Commit | Line | Data |
---|---|---|
21189e0f MK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
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 | |
7 | ||
8 | ||
9 | %define module flask | |
10 | Summary: A microframework based on Werkzeug, Jinja2 and good intentions | |
11 | Name: python-%{module} | |
12 | Version: 0.10.1 | |
d79c30c3 | 13 | Release: 4 |
21189e0f MK |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
16 | # https://pypi.python.org/packages/source/F/Flask/Flask-0.10.1.tar.gz | |
17 | Source0: http://pypi.python.org/packages/source/F/Flask/Flask-%{version}.tar.gz | |
18 | # Source0-md5: 378670fe456957eb3c27ddaef60b2b24 | |
19 | URL: http://flask.pocoo.org/ | |
20 | %if %{with python2} | |
21 | BuildRequires: python-devel | |
22 | BuildRequires: python-distribute | |
23 | BuildRequires: python-distribute | |
24 | BuildRequires: python-jinja2 >= 2.4 | |
25 | BuildRequires: python-werkzeug >= 0.6.1 | |
26 | BuildRequires: rpm-pythonprov | |
b057849d | 27 | BuildRequires: rpmbuild(macros) >= 1.710 |
21189e0f MK |
28 | |
29 | %endif | |
30 | %if %{with python3} | |
31 | BuildRequires: python3-devel | |
32 | BuildRequires: python3-distribute | |
33 | BuildRequires: python3-jinja2 >= 2.4 | |
34 | BuildRequires: python3-modules | |
35 | BuildRequires: python3-werkzeug >= 0.6.1 | |
36 | %endif | |
37 | ||
38 | Requires: python-itsdangerous | |
39 | Requires: python-jinja2 >= 2.4 | |
40 | Requires: python-modules | |
41 | Requires: python-werkzeug >= 0.6.1 | |
42 | BuildArch: noarch | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | Flask is a microframework for Python based on Werkzeug, Jinja 2 and | |
47 | good intentions. | |
48 | ||
49 | %package -n python3-%{module} | |
50 | Summary: - | |
51 | Summary(pl.UTF-8): - | |
52 | Group: Libraries/Python | |
53 | Requires: python3-itsdangerous | |
54 | Requires: python3-jinja2 >= 2.4 | |
55 | Requires: python3-modules | |
56 | Requires: python3-werkzeug >= 0.6.1 | |
57 | ||
58 | %description -n python3-%{module} | |
59 | Flask is a microframework for Python based on Werkzeug, Jinja 2 and | |
60 | good intentions. | |
61 | ||
62 | # %description -n python3-%{module} -l pl.UTF-8 | |
63 | ||
64 | ||
65 | %prep | |
66 | %setup -q -n Flask-%{version} | |
67 | ||
68 | %build | |
69 | %if %{with python2} | |
bb76c6e5 | 70 | %py_build %{?with_tests:test} |
21189e0f MK |
71 | %endif |
72 | ||
73 | %if %{with python3} | |
bb76c6e5 | 74 | %py3_build %{?with_tests:test} |
21189e0f MK |
75 | %endif |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
bb76c6e5 | 81 | %py_install |
21189e0f MK |
82 | |
83 | %py_postclean | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
bb76c6e5 | 87 | %py3_install |
21189e0f MK |
88 | %endif |
89 | ||
90 | # in case there are examples provided | |
91 | %if %{with python2} | |
92 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
93 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
94 | %endif | |
95 | %if %{with python3} | |
96 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
97 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
98 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
99 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
100 | %endif | |
101 | ||
102 | ||
103 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
110 | %doc AUTHORS CHANGES README | |
111 | %{py_sitescriptdir}/%{module} | |
112 | %if "%{py_ver}" > "2.4" | |
113 | %{py_sitescriptdir}/Flask-*.egg-info | |
114 | %endif | |
115 | %{_examplesdir}/%{name}-%{version} | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-%{module} | |
120 | %defattr(644,root,root,755) | |
121 | %doc AUTHORS CHANGES LICENSE | |
122 | %{py3_sitescriptdir}/%{module} | |
123 | %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info | |
124 | %{_examplesdir}/python3-%{module}-%{version} | |
125 | %endif |