author | Felix Yan
<felixonmars@archlinux.org> 2014-09-11 07:08:27 UTC |
committer | Felix Yan
<felixonmars@archlinux.org> 2014-09-11 07:08:27 UTC |
parent | 57ccf3a28c9967810dcd788b1c843f68589ddc69 |
PKGBUILD | +11 | -7 |
use_system_ca_certificates.patch | +57 | -0 |
diff --git a/PKGBUILD b/PKGBUILD index 353d7a8..e462e10 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,18 +2,24 @@ # Contributor: Thomas Dziedzic < gostrc at gmail > pkgname=('python-tornado' 'python2-tornado') -pkgver=4.0.1 +pkgver=4.0.2 pkgrel=1 pkgdesc='open source version of the scalable, non-blocking web server and tools' arch=('i686' 'x86_64') url='http://www.tornadoweb.org/' license=('Apache') -makedepends=('python-setuptools' 'python2-setuptools' 'python2-backports.ssl_match_hostname' 'git' 'python-certifi' 'python2-certifi') +makedepends=('python-setuptools' 'python2-setuptools' 'python2-backports.ssl_match_hostname' 'git') checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted') -source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver") -sha512sums=('SKIP') +source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver" + use_system_ca_certificates.patch) +sha512sums=('SKIP' + '6e50e9ecf361d54d9f67e1f12185cf58863ad0eae72fbe7cc24e8eaf94874255009a030249bb51adf06e98c7ed0b17d8c6d9ee65190ebc341d6857c0efbc7840') prepare() { + cd tornado + patch -p1 -i ../use_system_ca_certificates.patch + + cd "$srcdir" cp -a tornado{,-py2} # python -> python2 rename @@ -42,14 +48,12 @@ check() { } package_python-tornado() { - depends=('python-certifi') - cd tornado python setup.py install --root="${pkgdir}" --optimize=1 } package_python2-tornado() { - depends=('python2-certifi' 'python2-backports.ssl_match_hostname') + depends=('python2-backports.ssl_match_hostname') cd tornado-py2 python2 setup.py install --root="${pkgdir}" --optimize=1 diff --git a/use_system_ca_certificates.patch b/use_system_ca_certificates.patch new file mode 100644 index 0000000..23a0f13 --- /dev/null +++ b/use_system_ca_certificates.patch @@ -0,0 +1,57 @@ +diff --git a/setup.py b/setup.py +index f09169f..d42c486 100644 +--- a/setup.py ++++ b/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 a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py +index f0f73fa..ffe3e40 100644 +--- a/tornado/simple_httpclient.py ++++ b/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 a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py +index 01b0d95..47a64e7 100644 +--- a/tornado/test/iostream_test.py ++++ b/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