]> git.pld-linux.org Git - packages/python3-flask.git/blob - python-flask.spec
- updated to 0.12
[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:        0.12
13 Release:        1
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:  c1d30f51cff4a38f9454b23328a15c5a
19 Patch0:         %{name}-python3.6.patch
20 URL:            http://flask.pocoo.org/
21 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
22 BuildRequires:  glibc-localedb-all
23 %endif
24 %if %{with python2}
25 BuildRequires:  python-click >= 2.0
26 BuildRequires:  python-devel >= 1:2.6
27 BuildRequires:  python-itsdangerous >= 0.21
28 BuildRequires:  python-jinja2 >= 2.4
29 BuildRequires:  python-modules >= 1:2.6
30 BuildRequires:  python-pytest
31 BuildRequires:  python-setuptools
32 BuildRequires:  python-werkzeug >= 0.7
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-click >= 2.0
36 BuildRequires:  python3-devel >= 1:3.3
37 BuildRequires:  python3-itsdangerous >= 0.21
38 BuildRequires:  python3-jinja2 >= 2.4
39 BuildRequires:  python3-modules >= 1:3.3
40 BuildRequires:  python3-pytest
41 BuildRequires:  python3-setuptools
42 BuildRequires:  python3-werkzeug >= 0.7
43 %endif
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
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
57 %description -l pl.UTF-8
58 Flask to mikroszkielet dla Pythona oparty na modułach Werkzeug i
59 Jinja2 oraz dobrych intencjach.
60
61 %package -n python3-%{module}
62 Summary:        A microframework based on Werkzeug, Jinja2 and good intentions
63 Summary(pl.UTF-8):      Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach
64 Group:          Libraries/Python
65 Requires:       python3-modules >= 1:3.3
66
67 %description -n python3-%{module}
68 Flask is a microframework for Python based on Werkzeug, Jinja 2 and
69 good intentions.
70
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
79
80 %description apidocs
81 Documentation for Python Flask package.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja do pakietu Pythona Flask.
85
86 %prep
87 %setup -q -n Flask-%{version}
88 %patch0 -p1
89
90 %build
91 %if %{with python2}
92 %py_build
93
94 %{?with_tests:%{__python} -m pytest tests}
95 %endif
96
97 %if %{with python3}
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
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110
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
120 %if %{with python2}
121 %py_install
122
123 %py_postclean
124
125 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flask{,-2}
126 ln -sf flask-2 $RPM_BUILD_ROOT%{_bindir}/flask
127
128 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
130 %endif
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %if %{with python2}
136 %files
137 %defattr(644,root,root,755)
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
142 %if "%{py_ver}" > "2.4"
143 %{py_sitescriptdir}/Flask-%{version}-py*.egg-info
144 %endif
145 %{_examplesdir}/%{name}-%{version}
146 %endif
147
148 %if %{with python3}
149 %files -n python3-%{module}
150 %defattr(644,root,root,755)
151 %doc AUTHORS CHANGES LICENSE README
152 %attr(755,root,root) %{_bindir}/flask-3
153 %{py3_sitescriptdir}/flask
154 %{py3_sitescriptdir}/Flask-%{version}-py*.egg-info
155 %{_examplesdir}/python3-%{module}-%{version}
156 %endif
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
This page took 0.127721 seconds and 3 git commands to generate.