*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / certifi / certifi-2019.6.16.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
7
8 inherit distutils-r1 prefix readme.gentoo-r1
9
10 DESCRIPTION="Python package for providing Mozilla's CA Bundle"
11 HOMEPAGE="http://certifi.io/ https://pypi.org/project/certifi"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="MPL-2.0"
15 SLOT="0"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh 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"
17 IUSE=""
18
19 RDEPEND="app-misc/ca-certificates"
20 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
21
22 # Do not drop this patch -- this will affect system's security
23 PATCHES=( "${FILESDIR}"/certifi-2018.4.16-use-system-cacerts.patch )
24
25 python_prepare_all() {
26         distutils-r1_python_prepare_all
27
28         eprefixify certifi/core.py
29 }
30
31 python_install_all() {
32         distutils-r1_python_install_all
33
34         local DOC_CONTENTS="
35                 In Gentoo, we don't use certifi's bundled CA certificates.
36                 Instead we remove bundled cacert.pem and patch certifi
37                 to return system's CA certificates.
38         "
39         readme.gentoo_create_doc
40
41         # Precaution -- nothing should use bundled CA certificates
42         find "${D}" -name 'cacert.pem' -delete || die "Failed to delete bundled CA certificates"
43 }