1 |
%define oname tornado |
2 |
# we don't want to provide private python extension libs |
3 |
%define _exclude_files_from_autoprov %{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so |
4 |
|
5 |
Name: python-%{oname} |
6 |
Version: 3.2.2 |
7 |
Release: %mkrel 2 |
8 |
Summary: Scalable, non-blocking web server and tools |
9 |
|
10 |
Group: Development/Python |
11 |
License: ASL 2.0 |
12 |
URL: http://www.tornadoweb.org |
13 |
Source0: https://pypi.python.org/packages/source/t/%{oname}/%{oname}-%{version}.tar.gz |
14 |
BuildRequires: pkgconfig(python) |
15 |
Requires: python-pycurl |
16 |
Requires: python-simplejson |
17 |
BuildRequires: python-tools |
18 |
BuildRequires: python-futures |
19 |
BuildRequires: python-backports-ssl_match_hostname |
20 |
BuildRequires: python-setuptools |
21 |
BuildRequires: python3-setuptools |
22 |
BuildRequires: pkgconfig(python3) |
23 |
|
24 |
%description |
25 |
Tornado is an open source version of the scalable, non-blocking web server and |
26 |
and tools. |
27 |
|
28 |
The framework is distinct from most mainstream web server frameworks (and |
29 |
certainly most Python frameworks) because it is non-blocking and reasonably |
30 |
fast. Because it is non-blocking and uses epoll, it can handle thousands of |
31 |
simultaneous standing connections, which means it is ideal for real-time web |
32 |
services. |
33 |
|
34 |
%package doc |
35 |
Summary: Examples for python-tornado |
36 |
Group: Development/Python |
37 |
Requires: %{name} = %{version}-%{release} |
38 |
|
39 |
%description doc |
40 |
Tornado is an open source version of the scalable, non-blocking web server and |
41 |
and tools. This package contains some example applications. |
42 |
|
43 |
%package -n python3-tornado |
44 |
Summary: Scalable, non-blocking web server and tools |
45 |
Group: Development/Python |
46 |
|
47 |
%description -n python3-tornado |
48 |
Tornado is an open source version of the scalable, non-blocking web |
49 |
server and tools. |
50 |
|
51 |
The framework is distinct from most mainstream web server frameworks |
52 |
(and certainly most Python frameworks) because it is non-blocking and |
53 |
reasonably fast. Because it is non-blocking and uses epoll, it can |
54 |
handle thousands of simultaneous standing connections, which means it is |
55 |
ideal for real-time web services. |
56 |
|
57 |
%package -n python3-tornado-doc |
58 |
Summary: Examples for python-tornado |
59 |
Group: Development/Python |
60 |
Requires: python3-tornado = %{version}-%{release} |
61 |
|
62 |
%description -n python3-tornado-doc |
63 |
Tornado is an open source version of the scalable, non-blocking web |
64 |
server and and tools. This package contains some example applications. |
65 |
|
66 |
%prep |
67 |
%setup -q -n %{oname}-%{version} |
68 |
|
69 |
# remove shebang from files |
70 |
%{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py |
71 |
|
72 |
# spurious permission fix |
73 |
find demos/ -name "*.py" -exec chmod -x {} \; |
74 |
|
75 |
# remove empty file |
76 |
rm -rf demos/facebook/static/facebook.js |
77 |
|
78 |
cp -a . %{py3dir} |
79 |
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' |
80 |
|
81 |
%build |
82 |
pushd %{py3dir} |
83 |
%{__python3} setup.py build |
84 |
popd |
85 |
|
86 |
%{__python} setup.py build |
87 |
|
88 |
%install |
89 |
pushd %{py3dir} |
90 |
PATH=$PATH:%{buildroot}%{python3_sitelib}/%{oname} |
91 |
%{__python3} setup.py install --skip-build --root=%{buildroot} |
92 |
popd |
93 |
|
94 |
PATH=$PATH:%{buildroot}%{python_sitelib}/%{oname} |
95 |
%{__python} setup.py install --skip-build --root=%{buildroot} |
96 |
|
97 |
%check |
98 |
pushd %{py3dir} |
99 |
PYTHONPATH=%{python3_sitearch} \ |
100 |
%{__python3} -m tornado.test.runtests --verbose || : |
101 |
popd |
102 |
|
103 |
PYTHONPATH=%{python_sitearch} \ |
104 |
%{__python} -m tornado.test.runtests --verbose || : |
105 |
|
106 |
|
107 |
%files |
108 |
%doc README.rst PKG-INFO |
109 |
%{python_sitearch}/%{oname}/ |
110 |
%{python_sitearch}/%{oname}-%{version}-py%{py_ver}.egg-info/ |
111 |
|
112 |
%files doc |
113 |
%doc demos |
114 |
|
115 |
%files -n python3-tornado |
116 |
%doc README.rst PKG-INFO |
117 |
%{python3_sitearch}/%{oname}/ |
118 |
%{python3_sitearch}/%{oname}-%{version}-*.egg-info |
119 |
|
120 |
%files -n python3-tornado-doc |
121 |
%doc demos |
122 |
|