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