%define oname tornado # we don't want to provide private python extension libs %define _exclude_files_from_autoprov %{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so Name: python-%{oname} Version: 3.2.2 Release: %mkrel 2 Summary: Scalable, non-blocking web server and tools Group: Development/Python License: ASL 2.0 URL: http://www.tornadoweb.org Source0: https://pypi.python.org/packages/source/t/%{oname}/%{oname}-%{version}.tar.gz BuildRequires: pkgconfig(python) Requires: python-pycurl Requires: python-simplejson BuildRequires: python-tools BuildRequires: python-futures BuildRequires: python-backports-ssl_match_hostname BuildRequires: python-setuptools BuildRequires: python3-setuptools BuildRequires: pkgconfig(python3) %description Tornado is an open source version of the scalable, non-blocking web server and and tools. The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. %package doc Summary: Examples for python-tornado Group: Development/Python Requires: %{name} = %{version}-%{release} %description doc Tornado is an open source version of the scalable, non-blocking web server and and tools. This package contains some example applications. %package -n python3-tornado Summary: Scalable, non-blocking web server and tools Group: Development/Python %description -n python3-tornado Tornado is an open source version of the scalable, non-blocking web server and tools. The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. %package -n python3-tornado-doc Summary: Examples for python-tornado Group: Development/Python Requires: python3-tornado = %{version}-%{release} %description -n python3-tornado-doc Tornado is an open source version of the scalable, non-blocking web server and and tools. This package contains some example applications. %prep %setup -q -n %{oname}-%{version} # remove shebang from files %{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py # spurious permission fix find demos/ -name "*.py" -exec chmod -x {} \; # remove empty file rm -rf demos/facebook/static/facebook.js cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %build pushd %{py3dir} %{__python3} setup.py build popd %{__python} setup.py build %install pushd %{py3dir} PATH=$PATH:%{buildroot}%{python3_sitelib}/%{oname} %{__python3} setup.py install --skip-build --root=%{buildroot} popd PATH=$PATH:%{buildroot}%{python_sitelib}/%{oname} %{__python} setup.py install --skip-build --root=%{buildroot} %check pushd %{py3dir} PYTHONPATH=%{python3_sitearch} \ %{__python3} -m tornado.test.runtests --verbose || : popd PYTHONPATH=%{python_sitearch} \ %{__python} -m tornado.test.runtests --verbose || : %files %doc README.rst PKG-INFO %{python_sitearch}/%{oname}/ %{python_sitearch}/%{oname}-%{version}-py%{py_ver}.egg-info/ %files doc %doc demos %files -n python3-tornado %doc README.rst PKG-INFO %{python3_sitearch}/%{oname}/ %{python3_sitearch}/%{oname}-%{version}-*.egg-info %files -n python3-tornado-doc %doc demos