python-httplib2: update to 0.9

Switch to setuptools.
Add python3.4 subpkg with pycompile support.
Add patch to use system ca certificates, via Debian.
This commit is contained in:
Alessio Sergi 2014-07-01 12:47:27 +02:00
parent 9aa60df60d
commit 28a1d66a84
4 changed files with 98 additions and 9 deletions

View file

@ -0,0 +1,25 @@
Description: Close connection on certificate mismatch to avoid reuse
Author: Roman Podolyaka <rpodolyaka...mirantis.com>
Forwarded: https://code.google.com/p/httplib2/issues/detail?id=282
diff -r 93291649202b python2/httplib2/__init__.py
--- a/python2/httplib2/__init__.py Tue Mar 26 14:17:48 2013 -0400
+++ b/python2/httplib2/__init__.py Tue Apr 23 10:32:15 2013 +0300
@@ -1030,7 +1030,7 @@
raise CertificateHostnameMismatch(
'Server presented certificate that does not match '
'host %s: %s' % (hostname, cert), hostname, cert)
- except ssl_SSLError, e:
+ except (ssl_SSLError, CertificateHostnameMismatch), e:
if sock:
sock.close()
if self.sock:
@@ -1040,7 +1040,7 @@
# to get at more detailed error information, in particular
# whether the error is due to certificate validation or
# something else (such as SSL protocol mismatch).
- if e.errno == ssl.SSL_ERROR_SSL:
+ if hasattr(e, 'errno') and e.errno == ssl.SSL_ERROR_SSL:
raise SSLHandshakeError(e)
else:
raise

View file

@ -0,0 +1,49 @@
Description: Use system ca certificates, not the bundled ones
Author: Marc Deslauriers <marc.deslauriers@canonical.com>
Forwarded: not-needed
Bug-Ubuntu: https://launchpad.net/bugs/882027
Index: b/python2/httplib2/__init__.py
===================================================================
--- a/python2/httplib2/__init__.py 2013-03-18 22:37:43.423868573 +0100
+++ b/python2/httplib2/__init__.py 2013-03-18 22:37:43.419868572 +0100
@@ -190,9 +190,8 @@
import ca_certs_locater
CA_CERTS = ca_certs_locater.get()
except ImportError:
- # Default CA certificates file bundled with httplib2.
- CA_CERTS = os.path.join(
- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
+ # Use system CA certificates
+ CA_CERTS = "/etc/ssl/certs/ca-certificates.crt"
# Which headers are hop-by-hop headers by default
HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
Index: b/python3/httplib2/__init__.py
===================================================================
--- a/python3/httplib2/__init__.py 2013-03-18 22:37:43.423868573 +0100
+++ b/python3/httplib2/__init__.py 2013-03-18 22:37:43.419868572 +0100
@@ -123,9 +123,8 @@
# Which headers are hop-by-hop headers by default
HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
-# Default CA certificates file bundled with httplib2.
-CA_CERTS = os.path.join(
- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
+# Use system CA certificates
+CA_CERTS = "/etc/ssl/certs/ca-certificates.crt"
def _get_end2end_headers(response):
hopbyhop = list(HOP_BY_HOP)
Index: b/setup.py
===================================================================
--- a/setup.py 2013-03-18 22:37:43.423868573 +0100
+++ b/setup.py 2013-03-18 22:37:43.419868572 +0100
@@ -61,7 +61,6 @@
""",
package_dir=pkgdir,
packages=['httplib2'],
- package_data={'httplib2': ['*.txt']},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',

View file

@ -1,16 +1,30 @@
# Template file for 'python-httplib2'
pkgname=python-httplib2
version=0.7.7
revision=2
version=0.9
revision=1
noarch=yes
patch_args="-Np1"
wrksrc="httplib2-${version}"
build_style=python-module
hostmakedepends="python-setuptools"
makedepends="python-devel openssl-devel"
noarch="yes"
python_versions="2.7 3.4"
hostmakedepends="python-setuptools python3.4-setuptools"
makedepends="python-devel python3.4-devel openssl-devel"
depends="python"
pycompile_module="httplib2"
short_desc="A comprehensive HTTP client library in Python"
short_desc="A comprehensive HTTP client library (Python2)"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="https://github.com/jcgregorio/httplib2/"
license="MIT"
homepage="http://code.google.com/p/httplib2/"
distfiles="http://httplib2.googlecode.com/files/httplib2-${version}.tar.gz"
checksum=2e2ce18092c32d1ec54f8a447e14e33585e30f240b883bfeeca65f12b3bcfaf6
distfiles="https://pypi.python.org/packages/source/h/httplib2/httplib2-${version}.tar.gz"
checksum=39ea8c6a6d9f595c177a16134fc49a990ad8d382758cbf469c8659662f2f51ab
python3.4-httplib2_package() {
noarch=yes
depends="python3.4"
pycompile_version="3.4"
pycompile_module="httplib2"
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove usr/lib/python3.4
}
}

1
srcpkgs/python3.4-httplib2 Symbolic link
View file

@ -0,0 +1 @@
python-httplib2