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