From 426a60fda9dc396170de98ed6922ad0d9b745aa7 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Fri, 31 Oct 2014 20:00:00 +0100 Subject: [PATCH] New package: python-tornado-4.0.2 --- .../patches/use-system-ca-certificates.patch | 57 +++++++++++++++++++ srcpkgs/python-tornado/template | 32 +++++++++++ srcpkgs/python3.4-tornado | 1 + 3 files changed, 90 insertions(+) create mode 100644 srcpkgs/python-tornado/patches/use-system-ca-certificates.patch create mode 100644 srcpkgs/python-tornado/template create mode 120000 srcpkgs/python3.4-tornado diff --git a/srcpkgs/python-tornado/patches/use-system-ca-certificates.patch b/srcpkgs/python-tornado/patches/use-system-ca-certificates.patch new file mode 100644 index 00000000000..fa3a9c52a88 --- /dev/null +++ b/srcpkgs/python-tornado/patches/use-system-ca-certificates.patch @@ -0,0 +1,57 @@ +diff --git setup.py.orig setup.py +index f09169f..d42c486 100644 +--- setup.py.orig ++++ setup.py +@@ -120,7 +120,7 @@ if (platform.python_implementation() == 'CPython' and + + if setuptools is not None: + # If setuptools is not available, you're on your own for dependencies. +- install_requires = ['certifi'] ++ install_requires = [] + if sys.version_info < (3, 2): + install_requires.append('backports.ssl_match_hostname') + kwargs['install_requires'] = install_requires +diff --git tornado/simple_httpclient.py.orig tornado/simple_httpclient.py +index f0f73fa..ffe3e40 100644 +--- tornado/simple_httpclient.py.orig ++++ tornado/simple_httpclient.py +@@ -33,17 +33,9 @@ except ImportError: + # ssl is not available on Google App Engine. + ssl = None + +-try: +- import certifi +-except ImportError: +- certifi = None +- + + def _default_ca_certs(): +- if certifi is None: +- raise Exception("The 'certifi' package is required to use https " +- "in simple_httpclient") +- return certifi.where() ++ return "/etc/ssl/certs/ca-certificates.crt" + + + class SimpleAsyncHTTPClient(AsyncHTTPClient): +diff --git tornado/test/iostream_test.py.orig tornado/test/iostream_test.py +index 01b0d95..47a64e7 100644 +--- tornado/test/iostream_test.py.orig ++++ tornado/test/iostream_test.py +@@ -10,7 +10,6 @@ from tornado.stack_context import NullContext + from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, bind_unused_port, ExpectLog, gen_test + from tornado.test.util import unittest, skipIfNonUnix + from tornado.web import RequestHandler, Application +-import certifi + import errno + import logging + import os +@@ -855,7 +854,7 @@ class TestIOStreamStartTLS(AsyncTestCase): + def test_handshake_fail(self): + self.server_start_tls(_server_ssl_options()) + client_future = self.client_start_tls( +- dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs=certifi.where())) ++ dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs="/etc/ssl/certs/ca-certificates.crt")) + with ExpectLog(gen_log, "SSL Error"): + with self.assertRaises(ssl.SSLError): + yield client_future diff --git a/srcpkgs/python-tornado/template b/srcpkgs/python-tornado/template new file mode 100644 index 00000000000..d83f8c17e21 --- /dev/null +++ b/srcpkgs/python-tornado/template @@ -0,0 +1,32 @@ +# Template file for 'python-tornado' +pkgname=python-tornado +version=4.0.2 +revision=1 +wrksrc="tornado-${version}" +build_style=python-module +python_versions="2.7 3.4" +hostmakedepends="python-setuptools python3.4-setuptools" +makedepends="python-devel python3.4-devel" +depends="python-backports-ssl-match-hostname ca-certificates" +pycompile_module="tornado" +short_desc="Python2 web framework and asynchronous networking library" +maintainer="Alessio Sergi " +homepage="http://www.tornadoweb.org/" +license="Apache-2.0" +distfiles="${PYPI_SITE}/t/tornado/tornado-${version}.tar.gz" +checksum=900c5124ebdb6598ca8e8a0c5888f41a5f14117952d5515258e3d20222b21bfa + +pre_build() { + # remove shebang + sed -i '/^#!\//,1d' tornado/*.py tornado/*/*.py +} + +python3.4-tornado_package() { + depends="ca-certificates" + pycompile_version="3.4" + pycompile_module="tornado" + short_desc="${short_desc/Python2/Python3.4}" + pkg_install() { + vmove usr/lib/python3.4 + } +} diff --git a/srcpkgs/python3.4-tornado b/srcpkgs/python3.4-tornado new file mode 120000 index 00000000000..3b643ca3cb1 --- /dev/null +++ b/srcpkgs/python3.4-tornado @@ -0,0 +1 @@ +python-tornado \ No newline at end of file