]>
Commit | Line | Data |
---|---|---|
21189e0f MK |
1 | # |
2 | # Conditional build: | |
68354320 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
21189e0f MK |
7 | |
8 | %define module flask | |
9 | Summary: A microframework based on Werkzeug, Jinja2 and good intentions | |
68354320 | 10 | Summary(pl.UTF-8): Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach |
21189e0f | 11 | Name: python-%{module} |
590f22ae | 12 | Version: 1.0.2 |
bab80cd0 | 13 | Release: 3 |
21189e0f MK |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
68354320 JB |
16 | #Source0Download: https://pypi.python.org/simple/Flask |
17 | Source0: https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz | |
590f22ae AM |
18 | # Source0-md5: 824f0f20aae1f44c9c7dc4054adb7969 |
19 | Patch0: 0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch | |
20 | Patch1: 0002-remove-DocVersion-related.patch | |
21 | Patch2: 0003-fix-issue-no-theme-named-flask-found.patch | |
22 | Patch3: 0004-empty-CONTRIBUTING-rst.patch | |
21189e0f | 23 | URL: http://flask.pocoo.org/ |
68354320 JB |
24 | %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?) |
25 | BuildRequires: glibc-localedb-all | |
26 | %endif | |
21189e0f | 27 | %if %{with python2} |
68354320 JB |
28 | BuildRequires: python-click >= 2.0 |
29 | BuildRequires: python-devel >= 1:2.6 | |
30 | BuildRequires: python-itsdangerous >= 0.21 | |
21189e0f | 31 | BuildRequires: python-jinja2 >= 2.4 |
68354320 JB |
32 | BuildRequires: python-modules >= 1:2.6 |
33 | BuildRequires: python-pytest | |
34 | BuildRequires: python-setuptools | |
35 | BuildRequires: python-werkzeug >= 0.7 | |
21189e0f MK |
36 | %endif |
37 | %if %{with python3} | |
68354320 JB |
38 | BuildRequires: python3-click >= 2.0 |
39 | BuildRequires: python3-devel >= 1:3.3 | |
40 | BuildRequires: python3-itsdangerous >= 0.21 | |
21189e0f | 41 | BuildRequires: python3-jinja2 >= 2.4 |
68354320 JB |
42 | BuildRequires: python3-modules >= 1:3.3 |
43 | BuildRequires: python3-pytest | |
44 | BuildRequires: python3-setuptools | |
45 | BuildRequires: python3-werkzeug >= 0.7 | |
21189e0f | 46 | %endif |
68354320 JB |
47 | %if %{with doc} |
48 | BuildRequires: sphinx-pdg | |
49 | %endif | |
50 | BuildRequires: rpm-pythonprov | |
51 | BuildRequires: rpmbuild(macros) >= 1.714 | |
52 | Requires: python-modules >= 1:2.6 | |
21189e0f MK |
53 | BuildArch: noarch |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
55 | ||
56 | %description | |
57 | Flask is a microframework for Python based on Werkzeug, Jinja 2 and | |
58 | good intentions. | |
59 | ||
68354320 JB |
60 | %description -l pl.UTF-8 |
61 | Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i | |
62 | Jinja2 oraz dobrych intencjach. | |
63 | ||
21189e0f | 64 | %package -n python3-%{module} |
68354320 JB |
65 | Summary: A microframework based on Werkzeug, Jinja2 and good intentions |
66 | Summary(pl.UTF-8): Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach | |
21189e0f | 67 | Group: Libraries/Python |
68354320 | 68 | Requires: python3-modules >= 1:3.3 |
21189e0f MK |
69 | |
70 | %description -n python3-%{module} | |
71 | Flask is a microframework for Python based on Werkzeug, Jinja 2 and | |
72 | good intentions. | |
73 | ||
68354320 JB |
74 | %description -n python3-%{module} -l pl.UTF-8 |
75 | Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i | |
76 | Jinja2 oraz dobrych intencjach. | |
77 | ||
78 | %package apidocs | |
79 | Summary: Documentation for Python Flask package | |
80 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Flask | |
81 | Group: Documentation | |
21189e0f | 82 | |
68354320 JB |
83 | %description apidocs |
84 | Documentation for Python Flask package. | |
85 | ||
86 | %description apidocs -l pl.UTF-8 | |
87 | Dokumentacja do pakietu Pythona Flask. | |
21189e0f MK |
88 | |
89 | %prep | |
90 | %setup -q -n Flask-%{version} | |
68354320 | 91 | %patch0 -p1 |
590f22ae AM |
92 | %patch1 -p1 |
93 | %patch2 -p1 | |
94 | %patch3 -p1 | |
21189e0f MK |
95 | |
96 | %build | |
97 | %if %{with python2} | |
68354320 JB |
98 | %py_build |
99 | ||
100 | %{?with_tests:%{__python} -m pytest tests} | |
21189e0f MK |
101 | %endif |
102 | ||
103 | %if %{with python3} | |
68354320 JB |
104 | %py3_build |
105 | ||
106 | %{?with_tests:LC_ALL=C.UTF-8 %{__python3} -m pytest tests} | |
107 | %endif | |
108 | ||
109 | %if %{with doc} | |
110 | PYTHONPATH=$(pwd) \ | |
111 | %{__make} -C docs html | |
21189e0f MK |
112 | %endif |
113 | ||
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
68354320 JB |
117 | %if %{with python3} |
118 | %py3_install | |
119 | ||
120 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-3} | |
121 | ||
122 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
123 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
124 | %endif | |
125 | ||
21189e0f | 126 | %if %{with python2} |
bb76c6e5 | 127 | %py_install |
21189e0f MK |
128 | |
129 | %py_postclean | |
21189e0f | 130 | |
68354320 JB |
131 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-2} |
132 | ln -sf flask-2 $RPM_BUILD_ROOT%{_bindir}/flask | |
21189e0f | 133 | |
21189e0f MK |
134 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
135 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
136 | %endif | |
21189e0f MK |
137 | |
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %if %{with python2} | |
142 | %files | |
143 | %defattr(644,root,root,755) | |
590f22ae | 144 | %doc AUTHORS CHANGES.rst LICENSE README.rst |
68354320 JB |
145 | %attr(755,root,root) %{_bindir}/flask |
146 | %attr(755,root,root) %{_bindir}/flask-2 | |
147 | %{py_sitescriptdir}/flask | |
21189e0f | 148 | %if "%{py_ver}" > "2.4" |
68354320 | 149 | %{py_sitescriptdir}/Flask-%{version}-py*.egg-info |
21189e0f MK |
150 | %endif |
151 | %{_examplesdir}/%{name}-%{version} | |
152 | %endif | |
153 | ||
154 | %if %{with python3} | |
155 | %files -n python3-%{module} | |
156 | %defattr(644,root,root,755) | |
590f22ae | 157 | %doc AUTHORS CHANGES.rst LICENSE README.rst |
68354320 JB |
158 | %attr(755,root,root) %{_bindir}/flask-3 |
159 | %{py3_sitescriptdir}/flask | |
21189e0f MK |
160 | %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info |
161 | %{_examplesdir}/python3-%{module}-%{version} | |
162 | %endif | |
68354320 JB |
163 | |
164 | %if %{with doc} | |
165 | %files apidocs | |
166 | %defattr(644,root,root,755) | |
167 | %doc docs/_build/html/{_images,_static,deploying,patterns,tutorial,*.html,*.js} | |
168 | %endif |