14
0
Files
python-tornado/python-tornado.spec

105 lines
3.2 KiB
RPMSpec

#
# spec file for package python-tornado
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-tornado
Version: 5.1
Release: 0
Summary: Python web framework and web server
License: Apache-2.0
Group: Development/Languages/Python
URL: http://www.tornadoweb.org
Source: https://files.pythonhosted.org/packages/source/t/tornado/tornado-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pycurl}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python
%if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24
Recommends: python-Twisted
Recommends: python-pycares
Recommends: python-pycurl
Recommends: python-service_identity
%endif
%if 0%{?sle_version} == 120300
BuildRequires: %{python_module backports_abc}
%endif
%if 0%{?sle_version} == 120000 && !0%{?is_opensuse}
BuildRequires: %{python_module backports.ssl_match_hostname}
BuildRequires: %{python_module certifi}
%endif
%if %{with python2}
BuildRequires: python-futures
BuildRequires: python-singledispatch
%endif
# SECTION test requirements
BuildRequires: python-backports_abc
%if %{python3_version_nodots} < 35
BuildRequires: python3-backports_abc
%endif
# /SECTION
%if %{python_version_nodots} < 35
Requires: python-backports_abc
%endif
%ifpython2
Requires: python-singledispatch
%if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24
Recommends: python-futures
%endif
%endif
%python_subpackages
%description
Tornado is a Python web framework and asynchronous networking library,
originally developed at FriendFeed. It uses non-blocking network I/O, and
supports long polling, WebSockets, and other applications that require a
long-lived connection to each user.
%prep
%setup -q -n tornado-%{version}
# Fix non-executable script rpmlint issue:
find demos tornado -name "*.py" -exec sed -i "/#\!\/usr\/bin\/.*/d" {} \;
%pre
# remove egg-info _file_, being replaced by an egg-info directory
if [ -f %{python_sitearch}/tornado-%{version}-py%{python_version}.egg-info ]; then
rm %{python_sitearch}/tornado-%{version}-py%{python_version}.egg-info
fi
%build
%python_build
%install
%python_install
%fdupes -s demos
%python_expand %fdupes %{buildroot}%{python_sitearch}
%check
export ASYNC_TEST_TIMEOUT=30
%python_exec -m tornado.test.runtests
%files %{python_files}
%license LICENSE
%doc demos
%{python_sitearch}/tornado
%{python_sitearch}/tornado-%{version}-py*.egg-info
%changelog