]> git.pld-linux.org Git - packages/python3-flask.git/blob - python-flask.spec
04343a7fa94e2551f97a940fff05e57fe0c08a63
[packages/python3-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_without  python3 # CPython 3.x module
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 Version:        1.0.2
13 Release:        2
14 License:        BSD
15 Group:          Development/Languages/Python
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:  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
23 URL:            http://flask.pocoo.org/
24 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
25 BuildRequires:  glibc-localedb-all
26 %endif
27 %if %{with python2}
28 BuildRequires:  python-click >= 2.0
29 BuildRequires:  python-devel >= 1:2.6
30 BuildRequires:  python-itsdangerous >= 0.21
31 BuildRequires:  python-jinja2 >= 2.4
32 BuildRequires:  python-modules >= 1:2.6
33 BuildRequires:  python-pytest
34 BuildRequires:  python-setuptools
35 BuildRequires:  python-werkzeug >= 0.7
36 %endif
37 %if %{with python3}
38 BuildRequires:  python3-click >= 2.0
39 BuildRequires:  python3-devel >= 1:3.3
40 BuildRequires:  python3-itsdangerous >= 0.21
41 BuildRequires:  python3-jinja2 >= 2.4
42 BuildRequires:  python3-modules >= 1:3.3
43 BuildRequires:  python3-pytest
44 BuildRequires:  python3-setuptools
45 BuildRequires:  python3-werkzeug >= 0.7
46 %endif
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
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
60 %description -l pl.UTF-8
61 Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i
62 Jinja2 oraz dobrych intencjach.
63
64 %package -n python3-%{module}
65 Summary:        A microframework based on Werkzeug, Jinja2 and good intentions
66 Summary(pl.UTF-8):      Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach
67 Group:          Libraries/Python
68 Requires:       python3-modules >= 1:3.3
69
70 %description -n python3-%{module}
71 Flask is a microframework for Python based on Werkzeug, Jinja 2 and
72 good intentions.
73
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
82
83 %description apidocs
84 Documentation for Python Flask package.
85
86 %description apidocs -l pl.UTF-8
87 Dokumentacja do pakietu Pythona Flask.
88
89 %prep
90 %setup -q -n Flask-%{version}
91 %patch0 -p1
92 %patch1 -p1
93 %patch2 -p1
94 %patch3 -p1
95
96 %build
97 %if %{with python2}
98 %py_build
99
100 %{?with_tests:%{__python} -m pytest tests}
101 %endif
102
103 %if %{with python3}
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
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
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
126 %if %{with python2}
127 %py_install
128
129 %py_postclean
130
131 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-2}
132 ln -sf flask-2 $RPM_BUILD_ROOT%{_bindir}/flask
133
134 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
135 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136 %endif
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %files
143 %defattr(644,root,root,755)
144 %doc AUTHORS CHANGES.rst LICENSE README.rst
145 %attr(755,root,root) %{_bindir}/flask
146 %attr(755,root,root) %{_bindir}/flask-2
147 %{py_sitescriptdir}/flask
148 %if "%{py_ver}" > "2.4"
149 %{py_sitescriptdir}/Flask-%{version}-py*.egg-info
150 %endif
151 %{_examplesdir}/%{name}-%{version}
152 %endif
153
154 %if %{with python3}
155 %files -n python3-%{module}
156 %defattr(644,root,root,755)
157 %doc AUTHORS CHANGES.rst LICENSE README.rst
158 %attr(755,root,root) %{_bindir}/flask-3
159 %{py3_sitescriptdir}/flask
160 %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info
161 %{_examplesdir}/python3-%{module}-%{version}
162 %endif
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
This page took 0.05667 seconds and 2 git commands to generate.