summaryrefslogtreecommitdiff
path: root/dev-python/certifi
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/certifi')
-rw-r--r--dev-python/certifi/certifi-2020.6.20-r1.ebuild41
-rw-r--r--dev-python/certifi/files/certifi-2020.6.20-use-system-cacerts.patch17
2 files changed, 58 insertions, 0 deletions
diff --git a/dev-python/certifi/certifi-2020.6.20-r1.ebuild b/dev-python/certifi/certifi-2020.6.20-r1.ebuild
new file mode 100644
index 000000000000..cde297db9e1a
--- /dev/null
+++ b/dev-python/certifi/certifi-2020.6.20-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 2020 Liguros Authors
+# Distributed under the terms of the GNU General Public License v2
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8,9} )
+
+inherit distutils-r1 prefix readme.gentoo-r1
+
+DESCRIPTION="Python package for providing Mozilla's CA Bundle"
+HOMEPAGE="https://certifi.io/ https://pypi.org/project/certifi"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="app-misc/ca-certificates"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+PATCH="$FILESDIR}/${P}-use-system-cacerts.patch"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ # Precaution -- nothing should use bundled CA certificates
+ rm certifi/cacert.pem || die "Failed to delete bundled CA certificates"
+
+ eprefixify certifi/core.py
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local DOC_CONTENTS="
+ In Gentoo, we don't use certifi's bundled CA certificates.
+ Instead we remove bundled cacert.pem and patch certifi
+ to return system's CA certificates.
+ "
+ readme.gentoo_create_doc
+}
diff --git a/dev-python/certifi/files/certifi-2020.6.20-use-system-cacerts.patch b/dev-python/certifi/files/certifi-2020.6.20-use-system-cacerts.patch
new file mode 100644
index 000000000000..750954fa869c
--- /dev/null
+++ b/dev-python/certifi/files/certifi-2020.6.20-use-system-cacerts.patch
@@ -0,0 +1,17 @@
+diff -urN certifi-2020.6.20.orig/certifi/core.py certifi-2020.6.20/certifi/core.py
+--- certifi-2020.6.20.orig/certifi/core.py 2020-08-01 17:50:13.139849550 +0200
++++ certifi-2020.6.20/certifi/core.py 2020-08-01 17:52:51.614857443 +0200
+@@ -51,10 +51,9 @@
+ # If we don't have importlib.resources, then we will just do the old logic
+ # of assuming we're on the filesystem and munge the path directly.
+ def where():
+- f = os.path.dirname(__file__)
+-
+- return os.path.join(f, "cacert.pem")
++ return "@GENTOO_PORTAGE_EPREFIX@/etc/ssl/certs/ca-certificates.crt"
+
+
+ def contents():
+- return read_text("certifi", "cacert.pem", encoding="ascii")
++ with open(where(), "r", encoding="ascii") as f:
++ return f.read()