]>
Commit | Line | Data |
---|---|---|
21189e0f MK |
1 | # |
2 | # Conditional build: | |
68354320 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
21189e0f MK |
5 | |
6 | %define module flask | |
7 | Summary: A microframework based on Werkzeug, Jinja2 and good intentions | |
68354320 | 8 | Summary(pl.UTF-8): Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach |
a305f6b1 AM |
9 | Name: python3-%{module} |
10 | Version: 2.0.2 | |
0a620b1b | 11 | Release: 3 |
21189e0f MK |
12 | License: BSD |
13 | Group: Development/Languages/Python | |
68354320 | 14 | #Source0Download: https://pypi.python.org/simple/Flask |
646195a4 | 15 | Source0: https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz |
a305f6b1 | 16 | # Source0-md5: f875da30335908956e2f9f3d0f224f2d |
590f22ae | 17 | Patch0: 0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch |
646195a4 | 18 | URL: https://flask.palletsprojects.com/ |
68354320 JB |
19 | %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?) |
20 | BuildRequires: glibc-localedb-all | |
21 | %endif | |
a305f6b1 | 22 | BuildRequires: python3-devel >= 1:3.6 |
68354320 | 23 | BuildRequires: python3-modules >= 1:3.3 |
68354320 | 24 | BuildRequires: python3-setuptools |
646195a4 JB |
25 | %if %{with tests} |
26 | BuildRequires: python3-click >= 5.1 | |
27 | BuildRequires: python3-itsdangerous >= 0.24 | |
28 | BuildRequires: python3-jinja2 >= 2.10.1 | |
29 | BuildRequires: python3-pytest | |
52427289 | 30 | BuildRequires: python3-werkzeug >= 0.15 |
21189e0f | 31 | %endif |
68354320 | 32 | %if %{with doc} |
646195a4 JB |
33 | BuildRequires: python3-pallets-sphinx-themes |
34 | BuildRequires: python3-sphinx_issues | |
35 | BuildRequires: sphinx-pdg-3 | |
68354320 JB |
36 | %endif |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
646195a4 | 39 | Requires: python-modules >= 1:2.7 |
21189e0f MK |
40 | BuildArch: noarch |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | Flask is a microframework for Python based on Werkzeug, Jinja 2 and | |
45 | good intentions. | |
46 | ||
68354320 JB |
47 | %description -l pl.UTF-8 |
48 | Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i | |
49 | Jinja2 oraz dobrych intencjach. | |
50 | ||
68354320 JB |
51 | %package apidocs |
52 | Summary: Documentation for Python Flask package | |
53 | Summary(pl.UTF-8): Dokumentacja do pakietu Pythona Flask | |
54 | Group: Documentation | |
21189e0f | 55 | |
68354320 JB |
56 | %description apidocs |
57 | Documentation for Python Flask package. | |
58 | ||
59 | %description apidocs -l pl.UTF-8 | |
60 | Dokumentacja do pakietu Pythona Flask. | |
21189e0f MK |
61 | |
62 | %prep | |
63 | %setup -q -n Flask-%{version} | |
68354320 | 64 | %patch0 -p1 |
21189e0f MK |
65 | |
66 | %build | |
68354320 JB |
67 | %py3_build |
68 | ||
646195a4 JB |
69 | %if %{with tests} |
70 | PYTHONPATH=$(pwd)/src \ | |
71 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
72 | %{__python3} -m pytest tests | |
73 | %endif | |
68354320 JB |
74 | |
75 | %if %{with doc} | |
646195a4 JB |
76 | PYTHONPATH=$(pwd)/src \ |
77 | %{__make} -C docs html \ | |
78 | SPHINXBUILD=sphinx-build-3 | |
21189e0f MK |
79 | %endif |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
68354320 JB |
84 | %py3_install |
85 | ||
86 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-3} | |
87 | ||
88 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
89 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
21189e0f MK |
90 | |
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
21189e0f MK |
94 | %files |
95 | %defattr(644,root,root,755) | |
52427289 | 96 | %doc CHANGES.rst LICENSE.rst README.rst |
68354320 JB |
97 | %attr(755,root,root) %{_bindir}/flask-3 |
98 | %{py3_sitescriptdir}/flask | |
21189e0f MK |
99 | %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info |
100 | %{_examplesdir}/python3-%{module}-%{version} | |
68354320 JB |
101 | |
102 | %if %{with doc} | |
103 | %files apidocs | |
104 | %defattr(644,root,root,755) | |
105 | %doc docs/_build/html/{_images,_static,deploying,patterns,tutorial,*.html,*.js} | |
106 | %endif |