diff --git a/httplib2-0.10.3.tar.gz b/httplib2-0.10.3.tar.gz new file mode 100644 index 0000000..567d1db --- /dev/null +++ b/httplib2-0.10.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e404d3b7bd86c1bc931906098e7c1305d6a3a6dcef141b8bb1059903abb3ceeb +size 204500 diff --git a/httplib2-0.9.2.tar.gz b/httplib2-0.9.2.tar.gz deleted file mode 100644 index aea91f6..0000000 --- a/httplib2-0.9.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c3aba1c9539711551f4d83e857b316b5134a1c4ddce98a875b7027be7dd6d988 -size 205165 diff --git a/httplib2-bnc-818100.patch b/httplib2-bnc-818100.patch deleted file mode 100644 index 4466103..0000000 --- a/httplib2-bnc-818100.patch +++ /dev/null @@ -1,21 +0,0 @@ -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 diff --git a/httplib2-use-system-certs.patch b/httplib2-use-system-certs.patch index 7c62093..f8b4ff3 100644 --- a/httplib2-use-system-certs.patch +++ b/httplib2-use-system-certs.patch @@ -43,18 +43,21 @@ Index: httplib2-0.9.2/python3/httplib2/__init__.py def _get_end2end_headers(response): hopbyhop = list(HOP_BY_HOP) -@@ -833,13 +832,17 @@ class HTTPSConnectionWithTimeout(http.cl - ca_certs=None, disable_ssl_certificate_validation=False): +@@ -838,16 +837,17 @@ + # TODO: implement proxy_info self.proxy_info = proxy_info context = None - if ca_certs is None: - ca_certs = CA_CERTS -- if (cert_file or ca_certs) and not disable_ssl_certificate_validation: -+ if not disable_ssl_certificate_validation: +- if (cert_file or ca_certs): ++ if True: if not hasattr(ssl, 'SSLContext'): raise CertificateValidationUnsupportedInPython31() - context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -- context.verify_mode = ssl.CERT_REQUIRED +- if disable_ssl_certificate_validation: +- context.verify_mode = ssl.CERT_NONE +- else: +- context.verify_mode = ssl.CERT_REQUIRED + + cafile = ca_certs + capath = None diff --git a/python-httplib2.changes b/python-httplib2.changes index 3d0bfbf..225543f 100644 --- a/python-httplib2.changes +++ b/python-httplib2.changes @@ -1,9 +1,45 @@ +------------------------------------------------------------------- +Wed Apr 19 22:13:57 UTC 2017 - toddrme2178@gmail.com + +- Source url must be https. + +------------------------------------------------------------------- +Wed Apr 19 14:16:35 UTC 2017 - toddrme2178@gmail.com + +- Spec file cleanups + +------------------------------------------------------------------- +Wed Apr 12 18:16:09 UTC 2017 - toddrme2178@gmail.com + +- Update to 0.10.3 + * Fix certificate validation on Python<=2.7.8 without ssl.CertificateError +- Update to 0.10.2 + * Just a reupload of 0.10.1, which was broken for Python3 + because wheel distribution doesn't play well with our 2/3 split code base. +- Update to 0.10.1 + * Remove VeriSign Class 3 CA from trusted certs + * Add IdenTrust DST Root CA X3 + * Support for specifying the SSL protocol version (Python v2) + * On App Engine use urlfetch's default deadline if None is passed. + * Fix TypeError on AppEngine “__init__() got an unexpected keyword argument 'ssl_version’” + * Send SNI data for SSL connections on Python 2.7.9+ + * Verify the server hostname if certificate validation is enabled + * Add proxy_headers argument to ProxyInfo constructor + * Make disable_ssl_certificate_validation work with Python 3.5. + * Fix socket error handling +- Remove httplib2-bnc-818100.patch, merged upstream. + ------------------------------------------------------------------- Wed Oct 12 19:50:16 UTC 2016 - rjschwei@suse.com - Project moved from code.google.com to GitHub, fix the url accordingly +------------------------------------------------------------------- +Wed Apr 27 14:38:59 UTC 2016 - jmatejek@suse.com + +- attempt to build multi-python + ------------------------------------------------------------------- Wed Mar 2 16:45:18 UTC 2016 - jmatejek@suse.com diff --git a/python-httplib2.spec b/python-httplib2.spec index 616cbe9..3e4581d 100644 --- a/python-httplib2.spec +++ b/python-httplib2.spec @@ -1,7 +1,7 @@ # # spec file for package python-httplib2 # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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 @@ -15,55 +15,60 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# Tests require network connection +%bcond_with tests +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-httplib2 -Version: 0.9.2 +Version: 0.10.3 Release: 0 Url: https://github.com/httplib2/httplib2 Summary: A Python HTTP client library License: MIT and Apache-2.0 and (MPL-1.1 or GPL-2.0+ or LGPL-2.1+) Group: Development/Libraries/Python -Source: http://pypi.python.org/packages/source/h/httplib2/httplib2-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/h/httplib2/httplib2-%{version}.tar.gz # PATCH-FIX-OPENSUSE: Don't ship private copy of Mozilla NSS certs, use system certs instead (bnc#761162) Patch0: httplib2-use-system-certs.patch -# PATCH-FIX-UPSTREAM: speilicke@suse.com -- SSL certificate hostname mismatch is checked only once -Patch1: httplib2-bnc-818100.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel +BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros +%if %{with tests} # Test requirements (for ssl module): -#BuildRequires: python -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -Requires: openssl-certs -%else +BuildRequires: python +BuildRequires: python3 +%endif Requires: ca-certificates -%endif -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else +BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -%endif +%python_subpackages %description A comprehensive HTTP client library that supports many features left out of other HTTP libraries. + %prep %setup -q -n httplib2-%{version} %patch0 -p1 -%patch1 -p1 %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install -#%%check -#python python2/httplib2test.py +%if %{with tests} +%check +%if %have_python2 +python2 python2/httplib2test.py +%endif +%if %have_python2 +python3 python3/httplib2test.py +%endif +%endif -%files +%files %{python_files} %defattr(-,root,root) -%{python_sitelib}/httplib2-%{version}-py%{py_ver}.egg-info +%{python_sitelib}/httplib2-%{version}-py*.egg-info %{python_sitelib}/httplib2 %changelog