summaryrefslogtreecommitdiff
path: root/app-misc/ca-certificates
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-misc/ca-certificates
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-misc/ca-certificates')
-rw-r--r--app-misc/ca-certificates/Manifest10
-rw-r--r--app-misc/ca-certificates/ca-certificates-20170717.3.36.1.ebuild190
-rw-r--r--app-misc/ca-certificates/ca-certificates-20180409.3.36.1-r1.ebuild179
-rw-r--r--app-misc/ca-certificates/ca-certificates-20180409.3.37.ebuild179
-rw-r--r--app-misc/ca-certificates/files/ca-certificates-20150426-root.patch49
-rw-r--r--app-misc/ca-certificates/metadata.xml17
6 files changed, 624 insertions, 0 deletions
diff --git a/app-misc/ca-certificates/Manifest b/app-misc/ca-certificates/Manifest
new file mode 100644
index 000000000000..85665467e7f9
--- /dev/null
+++ b/app-misc/ca-certificates/Manifest
@@ -0,0 +1,10 @@
+AUX ca-certificates-20150426-root.patch 1336 BLAKE2B f52a2ab1f84a18e447b37905f2d4fc6a8b59b9931db387e9045167973a0bb98ee11164ccbc13c7ea7fb545fab45a8112df5806a5a13d2b77abf682eec1390a15 SHA512 4e68e6068921e9ed54bda68af422a491cb530b60ffbb85fe1986a403cd9023522c179b5afcf65e22c223a665163d1c2d1993322d652053b72e3fe07efe692d59
+DIST ca-certificates_20170717.tar.xz 293028 BLAKE2B 85076cd980841f32e2544c7be020fca9bcd5ef7066ae3cef195cbf9755f8b8e800a8e4076662fa1b7da600c2235e49048eb6e1166b0618fc7685221ab790fed3 SHA512 dfeb5a19bb33bcb127a159b73fcc63b41c99827d77eb4a6069def0cffc7ae8dd10dab97c1ddfdd5b70d0c93e650a51ed5dcd03908516e7ca8b3022bf46eeb7e6
+DIST ca-certificates_20180409.tar.xz 246908 BLAKE2B b553d4347f1a5b88fe59c7269dee617f61cde54d4df1a3aa4b3a7e9aa4b2ee81415e5c421352505ca4b2e0e480b053ccb04024bddfb51450d298d8fdd0567c36 SHA512 e0742da19416d367618547107cc0f1cc045d5ba62c30fb7238e0e36ec0d19ea48e2ffdee2c68a9f06954025c58db9a5376f149e221ede95a3a029cda39d86a53
+DIST nss-3.36.1.tar.gz 23026430 BLAKE2B 76eaf5b24f8954a4e14cf556912250a3ddb7b333054a2ea4ee3d218493a8f12c77a37455aae354ef6ddd9bd55c33a269dad515806d70ef38727fa8a382d47fd4 SHA512 096fe4360b6d584a746ac6156830f8cff821fd173bd889d7a396238919328a227fa4ebb46f738970a4001773046f3dd4f4675b85ff6de8420a4a7657b3ba0c65
+DIST nss-3.37.tar.gz 23027581 BLAKE2B 0ce7190a029321d5620dc8b9aedf1f4252c53dbef57149afbad432b6bc4b590db026505d23f5c766827d5c0179ab931b8a0435a2e9785eff3db515ed7211e512 SHA512 ad5175f126705f57092ac80421ac005bcc32bb18a4a44a527df25994fa90b3bc18af08506683564f619a22076f71232e2b3c9e6e25d6312d0bfed63684139103
+DIST nss-cacert-class1-class3.patch 22950 BLAKE2B 9d5e60df5f161a3c27c41e5a9419440a54f888eda454e3cde5ebe626d4075b65cf9938b5144d0fb022377f4bd415bff5e5c67d104409860aa9391b3eb8872c68 SHA512 a5aa740bf110a3f0262e3f1ef2fc739ac2b44f042e220039d48aee8e97cd764d5c10718220364f4098aba955882bd02cadb5481512388971a8290312f88a7df0
+EBUILD ca-certificates-20170717.3.36.1.ebuild 6253 BLAKE2B 6bfae7c926cac36f7bb5358dd1113a6f8bb30bf0c12518ddbe9e0bd771dbf119bbb9e9592c026fde71910552cfd7864dc04b7e9e1686a316019d1bc7de1509b7 SHA512 d233304edde3acf2f0c9732debaa00641d1caa678e91c6fbd7b8ab40d9792fb8acba2468f54dcb34c9e5431aad969b57ce47afbe46bda1a7d5fa62041bfa8bf2
+EBUILD ca-certificates-20180409.3.36.1-r1.ebuild 5740 BLAKE2B c621da402c252de355a9b4bc3b9be63458444a490013e404fd9488a0ed653ee141311b28bacd8f0d0a791e9b985620adc6e50d824ba2d01f3156af42c6534496 SHA512 e16491771037d7c3e47be526a97f1ed10a13dd14992336258ea7b5ff8885f50efbb8ba9a2bfa799c4157e123e93a858090dbc3e1f736852337d8df12bac6df9b
+EBUILD ca-certificates-20180409.3.37.ebuild 5740 BLAKE2B c621da402c252de355a9b4bc3b9be63458444a490013e404fd9488a0ed653ee141311b28bacd8f0d0a791e9b985620adc6e50d824ba2d01f3156af42c6534496 SHA512 e16491771037d7c3e47be526a97f1ed10a13dd14992336258ea7b5ff8885f50efbb8ba9a2bfa799c4157e123e93a858090dbc3e1f736852337d8df12bac6df9b
+MISC metadata.xml 538 BLAKE2B 20dd319e6f583b4b6b93fdfc7fb965c54c7b92426715cf287611ea58ed5040ffac4afa77df2e6464a387c120a8d80d508c6e997c820eae9395ba859b13c5702e SHA512 f2779da4ea4b24e196b64d6e4c94d47e426d431508db58355a08ca420498cbbe2f322c5f8dc6e132b612baf03ee6bb1561beade226bd2f71d6afa160064d7a7c
diff --git a/app-misc/ca-certificates/ca-certificates-20170717.3.36.1.ebuild b/app-misc/ca-certificates/ca-certificates-20170717.3.36.1.ebuild
new file mode 100644
index 000000000000..a3ffec2423cc
--- /dev/null
+++ b/app-misc/ca-certificates/ca-certificates-20170717.3.36.1.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# The Debian ca-certificates package merely takes the CA database as it exists
+# in the nss package and repackages it for use by openssl.
+#
+# The issue with using the compiled debs directly is two fold:
+# - they do not update frequently enough for us to rely on them
+# - they pull the CA database from nss tip of tree rather than the release
+#
+# So we take the Debian source tools and combine them with the latest nss
+# release to produce (largely) the same end result. The difference is that
+# now we know our cert database is kept in sync with nss and, if need be,
+# can be sync with nss tip of tree more frequently to respond to bugs.
+
+# When triaging bugs from users, here's some handy tips:
+# - To see what cert is hitting errors, use openssl:
+# openssl s_client -port 443 -CApath /etc/ssl/certs/ -host $HOSTNAME
+# Focus on the errors written to stderr.
+#
+# - Look at the upstream log as to why certs were added/removed:
+# https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
+#
+# - If people want to add/remove certs, tell them to file w/mozilla:
+# https://bugzilla.mozilla.org/enter_bug.cgi?product=NSS&component=CA%20Certificates&version=trunk
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit eutils python-any-r1
+
+if [[ ${PV} == *.* ]] ; then
+ # Compile from source ourselves.
+ PRECOMPILED=false
+ inherit versionator
+
+ DEB_VER=$(get_version_component_range 1)
+ NSS_VER=$(get_version_component_range 2-)
+ RTM_NAME="NSS_${NSS_VER//./_}_RTM"
+else
+ # Debian precompiled version.
+ PRECOMPILED=true
+ inherit unpacker
+fi
+
+DESCRIPTION="Common CA Certificates PEM files"
+HOMEPAGE="https://packages.debian.org/sid/ca-certificates"
+NMU_PR=""
+if ${PRECOMPILED} ; then
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
+else
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${DEB_VER}${NMU_PR:++nmu}${NMU_PR}.tar.xz
+ https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/nss-${NSS_VER}.tar.gz
+ cacert? (
+ https://dev.gentoo.org/~axs/distfiles/nss-cacert-class1-class3.patch
+ )"
+fi
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="insecure_certs"
+${PRECOMPILED} || IUSE+=" cacert"
+
+DEPEND=""
+if ${PRECOMPILED} ; then
+ DEPEND+=" !<sys-apps/portage-2.1.10.41"
+fi
+# c_rehash: we run `c_rehash`
+# debianutils: we run `run-parts`
+RDEPEND="${DEPEND}
+ app-misc/c_rehash
+ sys-apps/debianutils"
+
+if ! ${PRECOMPILED}; then
+ DEPEND+=" ${PYTHON_DEPS}"
+fi
+
+S=${WORKDIR}
+
+pkg_setup() {
+ # For the conversion to having it in CONFIG_PROTECT_MASK,
+ # we need to tell users about it once manually first.
+ [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
+ || ewarn "You should run update-ca-certificates manually after etc-update"
+}
+
+src_unpack() {
+ ${PRECOMPILED} || default
+
+ # Do all the work in the image subdir to avoid conflicting with source
+ # dirs in $WORKDIR. Need to perform everything in the offset #381937
+ mkdir -p "image/${EPREFIX}"
+ cd "image/${EPREFIX}" || die
+
+ ${PRECOMPILED} && unpacker_src_unpack
+}
+
+src_prepare() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ mkdir -p usr/sbin
+ cp -p "${S}"/${PN}/sbin/update-ca-certificates usr/sbin/ || die
+
+ if use cacert ; then
+ pushd "${S}"/nss-${NSS_VER} >/dev/null
+ epatch "${DISTDIR}"/nss-cacert-class1-class3.patch
+ popd >/dev/null
+ fi
+ fi
+
+ default
+ eapply -p2 "${FILESDIR}"/${PN}-20150426-root.patch
+ local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
+ sed -i \
+ -e '/="$ROOT/s:ROOT:ROOT'"${EPREFIX}"':' \
+ -e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
+ usr/sbin/update-ca-certificates || die
+}
+
+src_compile() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ python_setup
+ local d="${S}/${PN}/mozilla" c="usr/share/${PN}"
+ # Grab the database from the nss sources.
+ cp "${S}"/nss-${NSS_VER}/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h} "${d}" || die
+ emake -C "${d}"
+
+ # Now move the files to the same places that the precompiled would.
+ mkdir -p etc/ssl/certs etc/ca-certificates/update.d "${c}"/mozilla
+ if use cacert ; then
+ mkdir -p "${c}"/cacert.org
+ mv "${d}"/CAcert_Inc..crt "${c}"/cacert.org/cacert.org_root.crt || die
+ fi
+ mv "${d}"/*.crt "${c}"/mozilla/ || die
+ else
+ mv usr/share/doc/{ca-certificates,${PF}} || die
+ fi
+
+ if ! use insecure_certs ; then
+ elog "To prevent applications relying on system's trusted root certificate store"
+ elog "from using CAs where at least one major browser vendor Gentoo is following"
+ elog "has decided to apply trust level restrictions, the following"
+ elog "certificate(s) were removed:"
+ # Remove untrusted certs from StartCom and WoSign (bug #598072)
+ elog "$(find "${c}" -type f \( \
+ -iname '*startcom*' \
+ -o -iname '*wosign*' \
+ \) -printf '%P removed; see https://bugs.gentoo.org/598072 for details\n' -delete)"
+ fi
+
+ (
+ echo "# Automatically generated by ${CATEGORY}/${PF}"
+ echo "# $(date -u)"
+ echo "# Do not edit."
+ cd "${c}"
+ find * -name '*.crt' | LC_ALL=C sort
+ ) > etc/ca-certificates.conf
+
+ sh usr/sbin/update-ca-certificates --root "${S}/image" || die
+}
+
+src_install() {
+ cp -pPR image/* "${D}"/ || die
+ if ! ${PRECOMPILED} ; then
+ cd ca-certificates
+ doman sbin/*.8
+ dodoc debian/README.* examples/ca-certificates-local/README
+ fi
+
+ echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
+ doenvd 98ca-certificates
+}
+
+pkg_postinst() {
+ if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
+ # if the user has local certs, we need to rebuild again
+ # to include their stuff in the db.
+ # However it's too overzealous when the user has custom certs in place.
+ # --fresh is to clean up dangling symlinks
+ "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
+ fi
+
+ if [ -n "$(find -L "${EROOT}"etc/ssl/certs/ -type l)" ] ; then
+ ewarn "Removing the following broken symlinks:"
+ ewarn "$(find -L "${EROOT}"/etc/ssl/certs/ -type l -printf '%p -> %l\n' -delete)"
+ fi
+}
diff --git a/app-misc/ca-certificates/ca-certificates-20180409.3.36.1-r1.ebuild b/app-misc/ca-certificates/ca-certificates-20180409.3.36.1-r1.ebuild
new file mode 100644
index 000000000000..8d5bc12f58ed
--- /dev/null
+++ b/app-misc/ca-certificates/ca-certificates-20180409.3.36.1-r1.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# The Debian ca-certificates package merely takes the CA database as it exists
+# in the nss package and repackages it for use by openssl.
+#
+# The issue with using the compiled debs directly is two fold:
+# - they do not update frequently enough for us to rely on them
+# - they pull the CA database from nss tip of tree rather than the release
+#
+# So we take the Debian source tools and combine them with the latest nss
+# release to produce (largely) the same end result. The difference is that
+# now we know our cert database is kept in sync with nss and, if need be,
+# can be sync with nss tip of tree more frequently to respond to bugs.
+
+# When triaging bugs from users, here's some handy tips:
+# - To see what cert is hitting errors, use openssl:
+# openssl s_client -port 443 -CApath /etc/ssl/certs/ -host $HOSTNAME
+# Focus on the errors written to stderr.
+#
+# - Look at the upstream log as to why certs were added/removed:
+# https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
+#
+# - If people want to add/remove certs, tell them to file w/mozilla:
+# https://bugzilla.mozilla.org/enter_bug.cgi?product=NSS&component=CA%20Certificates&version=trunk
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit eutils python-any-r1
+
+if [[ ${PV} == *.* ]] ; then
+ # Compile from source ourselves.
+ PRECOMPILED=false
+ inherit versionator
+
+ DEB_VER=$(get_version_component_range 1)
+ NSS_VER=$(get_version_component_range 2-)
+ RTM_NAME="NSS_${NSS_VER//./_}_RTM"
+else
+ # Debian precompiled version.
+ PRECOMPILED=true
+ inherit unpacker
+fi
+
+DESCRIPTION="Common CA Certificates PEM files"
+HOMEPAGE="https://packages.debian.org/sid/ca-certificates"
+NMU_PR=""
+if ${PRECOMPILED} ; then
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
+else
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${DEB_VER}${NMU_PR:++nmu}${NMU_PR}.tar.xz
+ https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/nss-${NSS_VER}.tar.gz
+ cacert? (
+ https://dev.gentoo.org/~axs/distfiles/nss-cacert-class1-class3.patch
+ )"
+fi
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE=""
+${PRECOMPILED} || IUSE+=" cacert"
+
+DEPEND=""
+if ${PRECOMPILED} ; then
+ DEPEND+=" !<sys-apps/portage-2.1.10.41"
+fi
+# c_rehash: we run `c_rehash`
+# debianutils: we run `run-parts`
+RDEPEND="${DEPEND}
+ app-misc/c_rehash
+ sys-apps/debianutils"
+
+if ! ${PRECOMPILED}; then
+ DEPEND+=" ${PYTHON_DEPS}"
+fi
+
+S=${WORKDIR}
+
+pkg_setup() {
+ # For the conversion to having it in CONFIG_PROTECT_MASK,
+ # we need to tell users about it once manually first.
+ [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
+ || ewarn "You should run update-ca-certificates manually after etc-update"
+}
+
+src_unpack() {
+ ${PRECOMPILED} || default
+
+ # Do all the work in the image subdir to avoid conflicting with source
+ # dirs in $WORKDIR. Need to perform everything in the offset #381937
+ mkdir -p "image/${EPREFIX}"
+ cd "image/${EPREFIX}" || die
+
+ ${PRECOMPILED} && unpacker_src_unpack
+}
+
+src_prepare() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ mkdir -p usr/sbin
+ cp -p "${S}"/${PN}/sbin/update-ca-certificates usr/sbin/ || die
+
+ if use cacert ; then
+ pushd "${S}"/nss-${NSS_VER} >/dev/null
+ eapply -p0 "${DISTDIR}"/nss-cacert-class1-class3.patch
+ popd >/dev/null
+ fi
+ fi
+
+ default
+ eapply -p2 "${FILESDIR}"/${PN}-20150426-root.patch
+ local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
+ sed -i \
+ -e '/="$ROOT/s:ROOT:ROOT'"${EPREFIX}"':' \
+ -e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
+ -e 's/openssl rehash/c_rehash/' \
+ usr/sbin/update-ca-certificates || die
+}
+
+src_compile() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ python_setup
+ local d="${S}/${PN}/mozilla" c="usr/share/${PN}"
+ # Grab the database from the nss sources.
+ cp "${S}"/nss-${NSS_VER}/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h} "${d}" || die
+ emake -C "${d}"
+
+ # Now move the files to the same places that the precompiled would.
+ mkdir -p etc/ssl/certs etc/ca-certificates/update.d "${c}"/mozilla
+ if use cacert ; then
+ mkdir -p "${c}"/cacert.org
+ mv "${d}"/CAcert_Inc..crt "${c}"/cacert.org/cacert.org_root.crt || die
+ fi
+ mv "${d}"/*.crt "${c}"/mozilla/ || die
+ else
+ mv usr/share/doc/{ca-certificates,${PF}} || die
+ fi
+
+ (
+ echo "# Automatically generated by ${CATEGORY}/${PF}"
+ echo "# $(date -u)"
+ echo "# Do not edit."
+ cd "${c}"
+ find * -name '*.crt' | LC_ALL=C sort
+ ) > etc/ca-certificates.conf
+
+ sh usr/sbin/update-ca-certificates --root "${S}/image" || die
+}
+
+src_install() {
+ cp -pPR image/* "${D}"/ || die
+ if ! ${PRECOMPILED} ; then
+ cd ca-certificates
+ doman sbin/*.8
+ dodoc debian/README.* examples/ca-certificates-local/README
+ fi
+
+ echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
+ doenvd 98ca-certificates
+}
+
+pkg_postinst() {
+ if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
+ # if the user has local certs, we need to rebuild again
+ # to include their stuff in the db.
+ # However it's too overzealous when the user has custom certs in place.
+ # --fresh is to clean up dangling symlinks
+ "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
+ fi
+
+ if [ -n "$(find -L "${EROOT}"etc/ssl/certs/ -type l)" ] ; then
+ ewarn "Removing the following broken symlinks:"
+ ewarn "$(find -L "${EROOT}"/etc/ssl/certs/ -type l -printf '%p -> %l\n' -delete)"
+ fi
+}
diff --git a/app-misc/ca-certificates/ca-certificates-20180409.3.37.ebuild b/app-misc/ca-certificates/ca-certificates-20180409.3.37.ebuild
new file mode 100644
index 000000000000..8d5bc12f58ed
--- /dev/null
+++ b/app-misc/ca-certificates/ca-certificates-20180409.3.37.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# The Debian ca-certificates package merely takes the CA database as it exists
+# in the nss package and repackages it for use by openssl.
+#
+# The issue with using the compiled debs directly is two fold:
+# - they do not update frequently enough for us to rely on them
+# - they pull the CA database from nss tip of tree rather than the release
+#
+# So we take the Debian source tools and combine them with the latest nss
+# release to produce (largely) the same end result. The difference is that
+# now we know our cert database is kept in sync with nss and, if need be,
+# can be sync with nss tip of tree more frequently to respond to bugs.
+
+# When triaging bugs from users, here's some handy tips:
+# - To see what cert is hitting errors, use openssl:
+# openssl s_client -port 443 -CApath /etc/ssl/certs/ -host $HOSTNAME
+# Focus on the errors written to stderr.
+#
+# - Look at the upstream log as to why certs were added/removed:
+# https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
+#
+# - If people want to add/remove certs, tell them to file w/mozilla:
+# https://bugzilla.mozilla.org/enter_bug.cgi?product=NSS&component=CA%20Certificates&version=trunk
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit eutils python-any-r1
+
+if [[ ${PV} == *.* ]] ; then
+ # Compile from source ourselves.
+ PRECOMPILED=false
+ inherit versionator
+
+ DEB_VER=$(get_version_component_range 1)
+ NSS_VER=$(get_version_component_range 2-)
+ RTM_NAME="NSS_${NSS_VER//./_}_RTM"
+else
+ # Debian precompiled version.
+ PRECOMPILED=true
+ inherit unpacker
+fi
+
+DESCRIPTION="Common CA Certificates PEM files"
+HOMEPAGE="https://packages.debian.org/sid/ca-certificates"
+NMU_PR=""
+if ${PRECOMPILED} ; then
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
+else
+ SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${DEB_VER}${NMU_PR:++nmu}${NMU_PR}.tar.xz
+ https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/nss-${NSS_VER}.tar.gz
+ cacert? (
+ https://dev.gentoo.org/~axs/distfiles/nss-cacert-class1-class3.patch
+ )"
+fi
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE=""
+${PRECOMPILED} || IUSE+=" cacert"
+
+DEPEND=""
+if ${PRECOMPILED} ; then
+ DEPEND+=" !<sys-apps/portage-2.1.10.41"
+fi
+# c_rehash: we run `c_rehash`
+# debianutils: we run `run-parts`
+RDEPEND="${DEPEND}
+ app-misc/c_rehash
+ sys-apps/debianutils"
+
+if ! ${PRECOMPILED}; then
+ DEPEND+=" ${PYTHON_DEPS}"
+fi
+
+S=${WORKDIR}
+
+pkg_setup() {
+ # For the conversion to having it in CONFIG_PROTECT_MASK,
+ # we need to tell users about it once manually first.
+ [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
+ || ewarn "You should run update-ca-certificates manually after etc-update"
+}
+
+src_unpack() {
+ ${PRECOMPILED} || default
+
+ # Do all the work in the image subdir to avoid conflicting with source
+ # dirs in $WORKDIR. Need to perform everything in the offset #381937
+ mkdir -p "image/${EPREFIX}"
+ cd "image/${EPREFIX}" || die
+
+ ${PRECOMPILED} && unpacker_src_unpack
+}
+
+src_prepare() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ mkdir -p usr/sbin
+ cp -p "${S}"/${PN}/sbin/update-ca-certificates usr/sbin/ || die
+
+ if use cacert ; then
+ pushd "${S}"/nss-${NSS_VER} >/dev/null
+ eapply -p0 "${DISTDIR}"/nss-cacert-class1-class3.patch
+ popd >/dev/null
+ fi
+ fi
+
+ default
+ eapply -p2 "${FILESDIR}"/${PN}-20150426-root.patch
+ local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
+ sed -i \
+ -e '/="$ROOT/s:ROOT:ROOT'"${EPREFIX}"':' \
+ -e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
+ -e 's/openssl rehash/c_rehash/' \
+ usr/sbin/update-ca-certificates || die
+}
+
+src_compile() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ python_setup
+ local d="${S}/${PN}/mozilla" c="usr/share/${PN}"
+ # Grab the database from the nss sources.
+ cp "${S}"/nss-${NSS_VER}/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h} "${d}" || die
+ emake -C "${d}"
+
+ # Now move the files to the same places that the precompiled would.
+ mkdir -p etc/ssl/certs etc/ca-certificates/update.d "${c}"/mozilla
+ if use cacert ; then
+ mkdir -p "${c}"/cacert.org
+ mv "${d}"/CAcert_Inc..crt "${c}"/cacert.org/cacert.org_root.crt || die
+ fi
+ mv "${d}"/*.crt "${c}"/mozilla/ || die
+ else
+ mv usr/share/doc/{ca-certificates,${PF}} || die
+ fi
+
+ (
+ echo "# Automatically generated by ${CATEGORY}/${PF}"
+ echo "# $(date -u)"
+ echo "# Do not edit."
+ cd "${c}"
+ find * -name '*.crt' | LC_ALL=C sort
+ ) > etc/ca-certificates.conf
+
+ sh usr/sbin/update-ca-certificates --root "${S}/image" || die
+}
+
+src_install() {
+ cp -pPR image/* "${D}"/ || die
+ if ! ${PRECOMPILED} ; then
+ cd ca-certificates
+ doman sbin/*.8
+ dodoc debian/README.* examples/ca-certificates-local/README
+ fi
+
+ echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
+ doenvd 98ca-certificates
+}
+
+pkg_postinst() {
+ if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
+ # if the user has local certs, we need to rebuild again
+ # to include their stuff in the db.
+ # However it's too overzealous when the user has custom certs in place.
+ # --fresh is to clean up dangling symlinks
+ "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
+ fi
+
+ if [ -n "$(find -L "${EROOT}"etc/ssl/certs/ -type l)" ] ; then
+ ewarn "Removing the following broken symlinks:"
+ ewarn "$(find -L "${EROOT}"/etc/ssl/certs/ -type l -printf '%p -> %l\n' -delete)"
+ fi
+}
diff --git a/app-misc/ca-certificates/files/ca-certificates-20150426-root.patch b/app-misc/ca-certificates/files/ca-certificates-20150426-root.patch
new file mode 100644
index 000000000000..6e41ac39e874
--- /dev/null
+++ b/app-misc/ca-certificates/files/ca-certificates-20150426-root.patch
@@ -0,0 +1,49 @@
+add a --root option so we can generate with DESTDIR installs
+
+--- a/image/usr/sbin/update-ca-certificates
++++ b/image/usr/sbin/update-ca-certificates
+@@ -30,6 +30,8 @@ LOCALCERTSDIR=/usr/local/share/ca-certificates
+ CERTBUNDLE=ca-certificates.crt
+ ETCCERTSDIR=/etc/ssl/certs
+ HOOKSDIR=/etc/ca-certificates/update.d
++ROOT=""
++RELPATH=""
+
+ while [ $# -gt 0 ];
+ do
+@@ -59,13 +61,25 @@ do
+ --hooksdir)
+ shift
+ HOOKSDIR="$1";;
++ --root|-r)
++ shift
++ # Needed as c_rehash wants to read the files directly.
++ # This gets us from $CERTSCONF to $CERTSDIR.
++ RELPATH="../../.."
++ ROOT=$(readlink -f "$1");;
+ --help|-h|*)
+- echo "$0: [--verbose] [--fresh]"
++ echo "$0: [--verbose] [--fresh] [--root <dir>]"
+ exit;;
+ esac
+ shift
+ done
+
++CERTSCONF="$ROOT$CERTSCONF"
++CERTSDIR="$ROOT$CERTSDIR"
++LOCALCERTSDIR="$ROOT$LOCALCERTSDIR"
++ETCCERTSDIR="$ROOT$ETCCERTSDIR"
++HOOKSDIR="$ROOT$HOOKSDIR"
++
+ if [ ! -s "$CERTSCONF" ]
+ then
+ fresh=1
+@@ -94,7 +107,7 @@ add() {
+ -e 's/,/_/g').pem"
+ if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
+ then
+- ln -sf "$CERT" "$PEM"
++ ln -sf "${RELPATH}${CERT#$ROOT}" "$PEM"
+ echo "+$PEM" >> "$ADDED"
+ fi
+ # Add trailing newline to certificate, if it is missing (#635570)
diff --git a/app-misc/ca-certificates/metadata.xml b/app-misc/ca-certificates/metadata.xml
new file mode 100644
index 000000000000..3aa7f10648b3
--- /dev/null
+++ b/app-misc/ca-certificates/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="cacert">
+ Include root certificates from CAcert (http://www.cacert.org/) and Software
+ in the Public Interest (http://www.spi-inc.org/)
+ </flag>
+ <flag name="insecure_certs">
+ Install certificates which are known to be untrustworthy.
+ </flag>
+ </use>
+</pkgmetadata>