From 9e561e42a64eab88381a241639d3982c948518f0e89adc4bd35207f75b712fa8 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Wed, 20 Jun 2012 11:42:51 +0000 Subject: [PATCH] - Don't ship private copy of Mozilla NSS certs, use system certs instead (bnc#761162) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httplib2?expand=0&rev=17 --- httplib2-use-system-certs.patch | 45 +++++++++++++++++++++++++++++++++ python-httplib2.changes | 6 +++++ python-httplib2.spec | 19 +++++++++----- 3 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 httplib2-use-system-certs.patch diff --git a/httplib2-use-system-certs.patch b/httplib2-use-system-certs.patch new file mode 100644 index 0000000..7117c4b --- /dev/null +++ b/httplib2-use-system-certs.patch @@ -0,0 +1,45 @@ +Only in a/python2/httplib2: cacerts.txt +diff -ru a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py +--- a/python2/httplib2/__init__.py 2012-03-02 21:12:34.000000000 +0100 ++++ b/python2/httplib2/__init__.py 2012-06-20 13:30:39.524140796 +0200 +@@ -180,9 +180,8 @@ + # requesting that URI again. + DEFAULT_MAX_REDIRECTS = 5 + +-# Default CA certificates file bundled with httplib2. +-CA_CERTS = os.path.join( +- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt") ++# Use system-wide CA certificates: ++CA_CERTS = '/etc/ssl/ca-bundle.pem' + + # Which headers are hop-by-hop headers by default + HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade'] +Only in b/python2/httplib2: .__init__.py.swp +Only in a/python3/httplib2: cacerts.txt +diff -ru a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py +--- a/python3/httplib2/__init__.py 2012-03-02 21:12:34.000000000 +0100 ++++ b/python3/httplib2/__init__.py 2012-06-20 13:30:22.156140376 +0200 +@@ -119,9 +119,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-wide CA certificates: ++CA_CERTS = '/etc/ssl/ca-bundle.pem' + + def _get_end2end_headers(response): + hopbyhop = list(HOP_BY_HOP) +Only in b/python3/httplib2: .__init__.py.swp +diff -ru a/setup.py b/setup.py +--- a/setup.py 2012-03-02 21:12:34.000000000 +0100 ++++ b/setup.py 2012-06-20 13:28:26.560137617 +0200 +@@ -63,7 +63,6 @@ + """, + package_dir=pkgdir, + packages=['httplib2'], +- package_data={'httplib2': ['*.txt']}, + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Web Environment', diff --git a/python-httplib2.changes b/python-httplib2.changes index f03f661..8844241 100644 --- a/python-httplib2.changes +++ b/python-httplib2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 20 11:41:56 UTC 2012 - saschpe@suse.de + +- Don't ship private copy of Mozilla NSS certs, use system certs + instead (bnc#761162) + ------------------------------------------------------------------- Tue Jun 5 09:56:01 UTC 2012 - cstender@opensuse.org diff --git a/python-httplib2.spec b/python-httplib2.spec index 3865bbd..b503688 100644 --- a/python-httplib2.spec +++ b/python-httplib2.spec @@ -24,14 +24,17 @@ Summary: A Python HTTP client library License: MIT Group: Development/Libraries/Python Source0: 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 BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: ca-certificates BuildRequires: python-devel -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +Requires: ca-certificates +%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 BuildArch: noarch %endif -%endif %description A comprehensive HTTP client library that supports many features @@ -39,15 +42,17 @@ left out of other HTTP libraries. %prep %setup -q -n httplib2-%{version} +%patch0 -p1 %build python setup.py build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} --record-rpm=INSTALLED_FILES +python setup.py install --prefix=%{_prefix} --root=%{buildroot} -%files -f INSTALLED_FILES +%files %defattr(-,root,root) -%doc CHANGELOG README +%doc README +%{python_sitelib}/* %changelog