]> git.pld-linux.org Git - packages/python-flask.git/blob - python-flask.spec
- updated to 1.1.4 (for python2.7) instead of accidental 2.0.2 commit
[packages/python-flask.git] / python-flask.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_with     python3 # CPython 3.x module (built from python3-flask.spec)
7
8 %define         module  flask
9 Summary:        A microframework based on Werkzeug, Jinja2 and good intentions
10 Summary(pl.UTF-8):      Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach
11 Name:           python-%{module}
12 # keep 1.x here for python2 support
13 Version:        1.1.4
14 Release:        1
15 License:        BSD
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.python.org/simple/Flask
18 Source0:        https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz
19 # Source0-md5:  49c23fb3096ee548f9737bbddc934c41
20 Patch0:         0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch
21 Patch1:         %{name}-pathlib2.patch
22 URL:            https://flask.palletsprojects.com/
23 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
24 BuildRequires:  glibc-localedb-all
25 %endif
26 %if %{with python2}
27 BuildRequires:  python-devel >= 1:2.7
28 BuildRequires:  python-modules >= 1:2.6
29 BuildRequires:  python-setuptools
30 %if %{with tests}
31 BuildRequires:  python-click >= 5.1
32 BuildRequires:  python-itsdangerous >= 0.24
33 BuildRequires:  python-jinja2 >= 2.10.1
34 BuildRequires:  python-pathlib2
35 BuildRequires:  python-pytest
36 BuildRequires:  python-werkzeug >= 0.15
37 %endif
38 %endif
39 %if %{with python3}
40 BuildRequires:  python3-devel >= 1:3.5
41 BuildRequires:  python3-modules >= 1:3.3
42 BuildRequires:  python3-setuptools
43 %if %{with tests}
44 BuildRequires:  python3-click >= 5.1
45 BuildRequires:  python3-itsdangerous >= 0.24
46 BuildRequires:  python3-jinja2 >= 2.10.1
47 BuildRequires:  python3-pytest
48 BuildRequires:  python3-werkzeug >= 0.15
49 %endif
50 %endif
51 %if %{with doc}
52 BuildRequires:  python3-pallets-sphinx-themes
53 BuildRequires:  python3-sphinx_issues
54 BuildRequires:  sphinx-pdg-3
55 %endif
56 BuildRequires:  rpm-pythonprov
57 BuildRequires:  rpmbuild(macros) >= 1.714
58 Requires:       python-modules >= 1:2.7
59 BuildArch:      noarch
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 %description
63 Flask is a microframework for Python based on Werkzeug, Jinja 2 and
64 good intentions.
65
66 %description -l pl.UTF-8
67 Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i
68 Jinja2 oraz dobrych intencjach.
69
70 %package -n python3-%{module}
71 Summary:        A microframework based on Werkzeug, Jinja2 and good intentions
72 Summary(pl.UTF-8):      Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach
73 Group:          Libraries/Python
74 Requires:       python3-modules >= 1:3.5
75
76 %description -n python3-%{module}
77 Flask is a microframework for Python based on Werkzeug, Jinja 2 and
78 good intentions.
79
80 %description -n python3-%{module} -l pl.UTF-8
81 Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i
82 Jinja2 oraz dobrych intencjach.
83
84 %package apidocs
85 Summary:        Documentation for Python Flask package
86 Summary(pl.UTF-8):      Dokumentacja do pakietu Pythona Flask
87 Group:          Documentation
88
89 %description apidocs
90 Documentation for Python Flask package.
91
92 %description apidocs -l pl.UTF-8
93 Dokumentacja do pakietu Pythona Flask.
94
95 %prep
96 %setup -q -n Flask-%{version}
97 %patch0 -p1
98 %patch1 -p1
99
100 %build
101 %if %{with python2}
102 %py_build
103
104 %if %{with tests}
105 PYTHONPATH=$(pwd)/src \
106 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
107 %{__python} -m pytest tests
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 PYTHONPATH=$(pwd)/src \
116 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 %{__python3} -m pytest tests
118 %endif
119 %endif
120
121 %if %{with doc}
122 PYTHONPATH=$(pwd)/src \
123 %{__make} -C docs html \
124         SPHINXBUILD=sphinx-build-3
125 %endif
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python3}
131 %py3_install
132
133 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-3}
134
135 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
136 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
137 %endif
138
139 %if %{with python2}
140 %py_install
141
142 %py_postclean
143
144 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-2}
145 ln -sf flask-2 $RPM_BUILD_ROOT%{_bindir}/flask
146
147 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
148 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
149 %endif
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %if %{with python2}
155 %files
156 %defattr(644,root,root,755)
157 %doc CHANGES.rst LICENSE.rst README.rst
158 %attr(755,root,root) %{_bindir}/flask
159 %attr(755,root,root) %{_bindir}/flask-2
160 %{py_sitescriptdir}/flask
161 %{py_sitescriptdir}/Flask-%{version}-py*.egg-info
162 %{_examplesdir}/%{name}-%{version}
163 %endif
164
165 %if %{with python3}
166 %files -n python3-%{module}
167 %defattr(644,root,root,755)
168 %doc CHANGES.rst LICENSE.rst README.rst
169 %attr(755,root,root) %{_bindir}/flask-3
170 %{py3_sitescriptdir}/flask
171 %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info
172 %{_examplesdir}/python3-%{module}-%{version}
173 %endif
174
175 %if %{with doc}
176 %files apidocs
177 %defattr(644,root,root,755)
178 %doc docs/_build/html/{_images,_static,deploying,patterns,tutorial,*.html,*.js}
179 %endif
This page took 0.511351 seconds and 3 git commands to generate.