]>
Commit | Line | Data |
---|---|---|
e481b9f1 | 1 | # NOTE: for versions >= 6 (for python 3.5+) see python3-tornado.spec |
450b20f9 JR |
2 | # |
3 | # Conditional build: | |
6e17dca3 | 4 | %bcond_without doc # Sphinx documentation |
466a4d38 | 5 | %bcond_with tests # tornado tests [use network] |
6e71b220 | 6 | %bcond_without python2 # CPython 2.x module |
e481b9f1 | 7 | %bcond_with python3 # CPython 3.x module |
450b20f9 JR |
8 | |
9 | %define module tornado | |
10 | Summary: Web framework and asynchronous networking library | |
6e71b220 | 11 | Summary(pl.UTF-8): Szkielet WWW i asynchroniczna biblioteka sieciowa |
450b20f9 | 12 | Name: python-%{module} |
e481b9f1 | 13 | # keep 5.x here for python2 support |
ad026674 | 14 | Version: 5.1.1 |
323a0f7a | 15 | Release: 3 |
450b20f9 JR |
16 | License: Apache v2.0 |
17 | Group: Libraries/Python | |
ad026674 | 18 | #Source0Download: https://pypi.org/simple/tornado/ |
6e17dca3 | 19 | Source0: https://files.pythonhosted.org/packages/source/t/tornado/%{module}-%{version}.tar.gz |
ad026674 | 20 | # Source0-md5: a1ce4f392d30ff0ebcb255150d89b826 |
6e17dca3 | 21 | #Source0: https://github.com/tornadoweb/tornado/archive/v%{version}.tar.gz |
450b20f9 | 22 | URL: http://www.tornadoweb.org/ |
450b20f9 | 23 | BuildRequires: rpm-pythonprov |
6e17dca3 | 24 | BuildRequires: rpmbuild(macros) >= 1.714 |
450b20f9 | 25 | BuildRequires: sed >= 4.0 |
6e71b220 | 26 | %if %{with python2} |
ad026674 JB |
27 | BuildRequires: python-devel >= 1:2.7.9 |
28 | BuildRequires: python-modules >= 1:2.7.9 | |
6e71b220 JB |
29 | BuildRequires: python-setuptools |
30 | %if %{with tests} | |
31 | BuildRequires: python-backports-ssl_match_hostname | |
32 | BuildRequires: python-backports_abc >= 0.4 | |
33 | BuildRequires: python-certifi | |
c531ea17 | 34 | BuildRequires: python-futures |
6e71b220 JB |
35 | BuildRequires: python-singledispatch |
36 | # SO_REUSEPORT option | |
37 | BuildRequires: uname(release) >= 3.9 | |
38 | %endif | |
39 | %endif | |
450b20f9 | 40 | %if %{with python3} |
6e17dca3 JB |
41 | BuildRequires: python3-devel >= 1:3.4 |
42 | BuildRequires: python3-modules >= 1:3.4 | |
6e71b220 JB |
43 | BuildRequires: python3-setuptools |
44 | %if %{with tests} | |
45 | %if "%{py3_ver}" < "3.5" | |
46 | BuildRequires: python3-backports_abc >= 0.4 | |
450b20f9 | 47 | %endif |
6e71b220 JB |
48 | %if "%{py3_ver}" < "3.4" |
49 | BuildRequires: python3-singledispatch | |
50 | %endif | |
51 | # SO_REUSEPORT option | |
52 | BuildRequires: uname(release) >= 3.9 | |
53 | %endif | |
54 | %endif | |
6e17dca3 JB |
55 | %if %{with doc} |
56 | BuildRequires: sphinx-pdg | |
57 | %endif | |
ad026674 | 58 | Requires: python-modules >= 1:2.7.9 |
450b20f9 JR |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
60 | ||
61 | %description | |
62 | Tornado is a Python web framework and asynchronous networking library, | |
63 | originally developed at FriendFeed. By using non-blocking network I/O, | |
64 | Tornado can scale to tens of thousands of open connections, making it | |
65 | ideal for long polling, WebSockets, and other applications that | |
66 | require a long-lived connection to each user. | |
67 | ||
6e71b220 JB |
68 | %description -l pl.UTF-8 |
69 | Tornado to szkielet WWW oraz asynchroniczna biblioteka sieciowa dla | |
70 | Pythona, oryginalnie powstałe w FriendFeed. Dzięki użyciu | |
71 | nieblokującego sieciowego we/wy, Tornado może się skalować do | |
72 | dziesiątek tysięcy otwartych połączeń, co czyni go idealnym do | |
73 | zastosowań z długim pobieraniem, WebSockets i innych wymagających | |
74 | długotrwałego połączenia z każdym użytkownikiem. | |
75 | ||
450b20f9 JR |
76 | %package -n python3-tornado |
77 | Summary: Web framework and asynchronous networking library | |
6e71b220 | 78 | Summary(pl.UTF-8): Szkielet WWW i asynchroniczna biblioteka sieciowa |
450b20f9 | 79 | Group: Libraries/Python |
6e17dca3 | 80 | Requires: python3-modules >= 1:3.4 |
450b20f9 JR |
81 | |
82 | %description -n python3-tornado | |
83 | Tornado is a Python web framework and asynchronous networking library, | |
84 | originally developed at FriendFeed. By using non-blocking network I/O, | |
85 | Tornado can scale to tens of thousands of open connections, making it | |
86 | ideal for long polling, WebSockets, and other applications that | |
87 | require a long-lived connection to each user. | |
88 | ||
6e71b220 JB |
89 | %description -n python3-tornado -l pl.UTF-8 |
90 | Tornado to szkielet WWW oraz asynchroniczna biblioteka sieciowa dla | |
91 | Pythona, oryginalnie powstałe w FriendFeed. Dzięki użyciu | |
92 | nieblokującego sieciowego we/wy, Tornado może się skalować do | |
93 | dziesiątek tysięcy otwartych połączeń, co czyni go idealnym do | |
94 | zastosowań z długim pobieraniem, WebSockets i innych wymagających | |
95 | długotrwałego połączenia z każdym użytkownikiem. | |
96 | ||
6e17dca3 JB |
97 | %package apidocs |
98 | Summary: API documentation for Python tornado module | |
99 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona tornado | |
100 | Group: Documentation | |
101 | ||
102 | %description apidocs | |
103 | API documentation for Python tornado module. | |
104 | ||
105 | %description apidocs -l pl.UTF-8 | |
106 | Dokumentacja API modułu Pythona tornado. | |
107 | ||
450b20f9 JR |
108 | %prep |
109 | %setup -q -n %{module}-%{version} | |
110 | ||
6e71b220 JB |
111 | # non-Linux |
112 | %{__rm} tornado/platform/{kqueue,windows}.py | |
450b20f9 | 113 | |
450b20f9 | 114 | %build |
6e71b220 JB |
115 | %if %{with python2} |
116 | TORNADO_EXTENSION=1 \ | |
e50bef49 JK |
117 | %py_build |
118 | ||
119 | %if %{with tests} | |
6e71b220 | 120 | cd build-2/lib* |
e50bef49 JK |
121 | %{__python} -m tornado.test.runtests |
122 | cd ../.. | |
123 | %endif | |
6e71b220 | 124 | %endif |
450b20f9 JR |
125 | |
126 | %if %{with python3} | |
6e71b220 JB |
127 | TORNADO_EXTENSION=1 \ |
128 | %py3_build | |
129 | ||
e50bef49 | 130 | %if %{with tests} |
6e71b220 | 131 | cd build-3/lib* |
e50bef49 JK |
132 | %{__python3} -m tornado.test.runtests |
133 | cd ../.. | |
134 | %endif | |
450b20f9 JR |
135 | %endif |
136 | ||
6e17dca3 JB |
137 | %if %{with doc} |
138 | # drop -W from sphinx options to allow build without optional imports (e.g. twisted) | |
139 | %{__make} -C docs sphinx \ | |
140 | SPHINXOPTS="-n -d build/doctrees ." | |
141 | %endif | |
142 | ||
450b20f9 JR |
143 | %install |
144 | rm -rf $RPM_BUILD_ROOT | |
450b20f9 | 145 | |
6e71b220 JB |
146 | %if %{with python2} |
147 | %py_install | |
450b20f9 | 148 | |
450b20f9 | 149 | %py_postclean |
6e71b220 JB |
150 | # just tornado tests with their data |
151 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/tornado/test | |
152 | %endif | |
450b20f9 JR |
153 | |
154 | %if %{with python3} | |
e50bef49 | 155 | %py3_install |
6e71b220 JB |
156 | # just tornado tests with their data |
157 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/tornado/test | |
450b20f9 JR |
158 | %endif |
159 | ||
160 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
161 | cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
162 | ||
163 | %clean | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
166 | %files | |
167 | %defattr(644,root,root,755) | |
168 | %doc README.rst | |
6e71b220 JB |
169 | %dir %{py_sitedir}/tornado |
170 | %attr(755,root,root) %{py_sitedir}/tornado/speedups.so | |
171 | %{py_sitedir}/tornado/*.py[co] | |
172 | %{py_sitedir}/tornado/platform | |
173 | %{py_sitedir}/tornado-%{version}-py*.egg-info | |
450b20f9 JR |
174 | %{_examplesdir}/%{name}-%{version} |
175 | ||
176 | %if %{with python3} | |
177 | %files -n python3-%{module} | |
178 | %defattr(644,root,root,755) | |
179 | %doc README.rst | |
6e71b220 JB |
180 | %dir %{py3_sitedir}/tornado |
181 | %attr(755,root,root) %{py3_sitedir}/tornado/speedups.cpython-*.so | |
182 | %{py3_sitedir}/tornado/*.py | |
183 | %{py3_sitedir}/tornado/platform | |
184 | %{py3_sitedir}/tornado/__pycache__ | |
185 | %{py3_sitedir}/tornado-%{version}-py*.egg-info | |
450b20f9 | 186 | %endif |
6e17dca3 JB |
187 | |
188 | %if %{with doc} | |
189 | %files apidocs | |
190 | %defattr(644,root,root,755) | |
191 | %doc docs/build/html/* | |
192 | %endif |