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