aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasufell <hasufell@hasufell.de>2015-02-07 00:28:48 +0100
committerhasufell <hasufell@hasufell.de>2015-02-07 00:28:48 +0100
commitc634cce959313629973378bdc5445fe234f5f4e1 (patch)
treecc0b7d9599cc8e12f5528c762dc7b3a449f25c36 /dev-python
parentdev-lang/ruby: add missing patch to :2.2 wrt #64 (diff)
downloadlibressl-c634cce959313629973378bdc5445fe234f5f4e1.tar.gz
libressl-c634cce959313629973378bdc5445fe234f5f4e1.tar.bz2
libressl-c634cce959313629973378bdc5445fe234f5f4e1.zip
dev-python/pycurl: initial import wrt #63
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/pycurl/Manifest1
-rw-r--r--dev-python/pycurl/files/pycurl-7.19.3.1-libressl.patch12
-rw-r--r--dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch64
-rw-r--r--dev-python/pycurl/metadata.xml14
-rw-r--r--dev-python/pycurl/pycurl-7.19.3.1-r2.ebuild70
5 files changed, 161 insertions, 0 deletions
diff --git a/dev-python/pycurl/Manifest b/dev-python/pycurl/Manifest
new file mode 100644
index 0000000..6405184
--- /dev/null
+++ b/dev-python/pycurl/Manifest
@@ -0,0 +1 @@
+DIST pycurl-7.19.3.1.tar.gz 116687 SHA256 c0d673fe99a9de07239eabe77c798f1b043f60c02afaec1430ceaf59d7501a4f SHA512 65ccb07638c663bc2a723664f1ade50f08eafa70bbcdc492cc99362a91873f453b63336a6b393d9f6591308f1450dadc64ce729b29990f37b170dda0eae0b23f WHIRLPOOL bf25bbb959e30140a261b9bede2e1a3675ec99c8f6c36f8afc8ca73288aa7f7cea6fa1d28385ca808872b251a676aebf8d77d203aed60619dab8852cac17b296
diff --git a/dev-python/pycurl/files/pycurl-7.19.3.1-libressl.patch b/dev-python/pycurl/files/pycurl-7.19.3.1-libressl.patch
new file mode 100644
index 0000000..7e4dd90
--- /dev/null
+++ b/dev-python/pycurl/files/pycurl-7.19.3.1-libressl.patch
@@ -0,0 +1,12 @@
+diff -urN a/src/pycurl.c b/src/pycurl.c
+--- a/src/pycurl.c 2015-02-03 23:55:34.220682877 -0500
++++ b/src/pycurl.c 2015-02-03 23:56:25.110682538 -0500
+@@ -4457,6 +4457,8 @@
+ runtime_ssl_lib = "none/other";
+ } else if (!strncmp(vi->ssl_version, "OpenSSL/", 8)) {
+ runtime_ssl_lib = "openssl";
++ } else if (!strncmp(vi->ssl_version, "LibreSSL/", 9)) {
++ runtime_ssl_lib = "openssl";
+ } else if (!strncmp(vi->ssl_version, "GnuTLS/", 7)) {
+ runtime_ssl_lib = "gnutls";
+ } else if (!strncmp(vi->ssl_version, "NSS/", 4)) {
diff --git a/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch b/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch
new file mode 100644
index 0000000..c7e1580
--- /dev/null
+++ b/dev-python/pycurl/files/pycurl-7.19.3.1-ssl-test.patch
@@ -0,0 +1,64 @@
+https://github.com/p-push/pycurl/commit/8644393bec56cd05c19d5dbe420ff741ba899d10
+diff --git a/tests/runwsgi.py b/tests/runwsgi.py
+index f419d7c..242ef1d 100644
+--- a/tests/runwsgi.py
++++ b/tests/runwsgi.py
+@@ -11,6 +11,10 @@
+
+ class Server(bottle.WSGIRefServer):
+ def run(self, handler): # pragma: no cover
++ self.srv = self.make_server(handler)
++ self.serve()
++
++ def make_server(self, handler):
+ from wsgiref.simple_server import make_server, WSGIRequestHandler
+ if self.quiet:
+ base = self.options.get('handler_class', WSGIRequestHandler)
+@@ -18,7 +22,10 @@ class QuietHandler(base):
+ def log_request(*args, **kw):
+ pass
+ self.options['handler_class'] = QuietHandler
+- self.srv = make_server(self.host, self.port, handler, **self.options)
++ srv = make_server(self.host, self.port, handler, **self.options)
++ return srv
++
++ def serve(self):
+ if sys.version_info[0] == 2 and sys.version_info[1] < 6:
+ # python 2.5 has no poll_interval
+ # and thus no way to stop the server
+@@ -27,20 +34,21 @@ def log_request(*args, **kw):
+ else:
+ self.srv.serve_forever(poll_interval=0.1)
+
+-class SslServer(bottle.CherryPyServer):
+- def run(self, handler):
+- import cherrypy.wsgiserver, cherrypy.wsgiserver.ssl_builtin
+- server = cherrypy.wsgiserver.CherryPyWSGIServer((self.host, self.port), handler)
++# http://www.socouldanyone.com/2014/01/bottle-with-ssl.html
++# https://github.com/mfm24/miscpython/blob/master/bottle_ssl.py
++class SslServer(Server):
++ def run(self, handler): # pragma: no cover
++ self.srv = self.make_server(handler)
++
++ import ssl
+ cert_dir = os.path.join(os.path.dirname(__file__), 'certs')
+- ssl_adapter = cherrypy.wsgiserver.ssl_builtin.BuiltinSSLAdapter(
+- os.path.join(cert_dir, 'server.crt'),
+- os.path.join(cert_dir, 'server.key'),
+- )
+- server.ssl_adapter = ssl_adapter
+- try:
+- server.start()
+- finally:
+- server.stop()
++ self.srv.socket = ssl.wrap_socket(
++ self.srv.socket,
++ keyfile=os.path.join(cert_dir, 'server.key'),
++ certfile=os.path.join(cert_dir, 'server.crt'),
++ server_side=True)
++
++ self.serve()
+
+ def start_bottle_server(app, port, server, **kwargs):
+ server_thread = ServerThread(app, port, server, kwargs)
+
diff --git a/dev-python/pycurl/metadata.xml b/dev-python/pycurl/metadata.xml
new file mode 100644
index 0000000..a495b52
--- /dev/null
+++ b/dev-python/pycurl/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>python</herd>
+<longdescription>
+PycURL is a Python interface to libcurl. PycURL can be used to fetch
+objects identified by a URL from a Python program, similar to the urllib
+Python module. All the functionality provided by libcurl can used through
+the pycurl interface.
+</longdescription>
+<longdescription lang="ja">
+PycURLはLibcurlへのパイソン・インターフェイスです。PycURLはPython言語モジュール>の様に、Python言語プログラムからURLで指定されたオブジェクトをダウンロードするに>も使えます。Libcurlで利用できる機能全てはPycURLインターフェイスを通して利用でき>ます。
+</longdescription>
+</pkgmetadata>
diff --git a/dev-python/pycurl/pycurl-7.19.3.1-r2.ebuild b/dev-python/pycurl/pycurl-7.19.3.1-r2.ebuild
new file mode 100644
index 0000000..f7e37cd
--- /dev/null
+++ b/dev-python/pycurl/pycurl-7.19.3.1-r2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/pycurl-7.19.3.1-r2.ebuild,v 1.7 2015/01/21 13:11:33 armin76 Exp $
+EAPI=5
+
+# The selftests fail with pypy, and urlgrabber segfaults for me.
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit distutils-r1
+
+DESCRIPTION="python binding for curl/libcurl"
+HOMEPAGE="https://github.com/pycurl/pycurl http://pypi.python.org/pypi/pycurl"
+SRC_URI="http://pycurl.sourceforge.net/download/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl examples ssl test"
+
+# Depend on a curl with curl_ssl_* USE flags.
+# libcurl must not be using an ssl backend we do not support.
+# If the libcurl ssl backend changes pycurl should be recompiled.
+# If curl uses gnutls, depend on at least gnutls 2.11.0 so that pycurl
+# does not need to initialize gcrypt threading and we do not need to
+# explicitly link to libgcrypt.
+RDEPEND=">=net-misc/curl-7.25.0-r1[ssl=]
+ ssl? (
+ net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-),-curl_ssl_polarssl(-)]
+ curl_ssl_gnutls? ( >=net-libs/gnutls-2.11.0 ) )"
+
+# bottle-0.12.7: https://github.com/pycurl/pycurl/issues/180
+# bottle-0.12.7: https://github.com/defnull/bottle/commit/f35197e2a18de1672831a70a163fcfd38327a802
+DEPEND="${RDEPEND}
+ test? ( dev-python/nose[${PYTHON_USEDEP}]
+ >=dev-python/bottle-0.12.7[${PYTHON_USEDEP}] )"
+# Needed for individual runs of testsuite by python impls.
+DISTUTILS_IN_SOURCE_BUILD=1
+
+PATCHES=( "${FILESDIR}"/${P}-{ssl-test,libressl}.patch )
+
+python_prepare_all() {
+ sed -e "/setup_args\['data_files'\] = /d" -i setup.py || die
+ distutils-r1_python_prepare_all
+}
+
+src_configure() {
+ # Override faulty detection in setup.py, bug 510974.
+ export PYCURL_SSL_LIBRARY=${CURL_SSL}
+}
+
+python_compile() {
+ python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ distutils-r1_python_compile
+}
+
+src_test() {
+ # suite shatters without this
+ local DISTUTILS_NO_PARALLEL_BUILD=1
+ distutils-r1_src_test
+}
+
+python_test() {
+ emake test
+}
+
+python_install_all() {
+ local HTML_DOCS=( doc/. )
+ use examples && local EXAMPLES=( examples/. )
+ distutils-r1_python_install_all
+}