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