summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <haubi@gentoo.org>2019-05-14 11:44:07 +0200
committerMichael Haubenwallner <haubi@gentoo.org>2019-05-14 11:44:57 +0200
commitc44b2f799a9bcf3cd1749c882d397cc21f1679dd (patch)
treead36bd744053e4703c820f527d3ed0b6b8e98288
parentdev-libs/openssl: no RDEPEND on c_rehash in prefix-stack (diff)
downloadprefix-c44b2f799a9bcf3cd1749c882d397cc21f1679dd.tar.gz
prefix-c44b2f799a9bcf3cd1749c882d397cc21f1679dd.tar.bz2
prefix-c44b2f799a9bcf3cd1749c882d397cc21f1679dd.zip
+app-misc/ca-certificates: tune RDEPEND for prefix-stack
Bug: https://bugs.gentoo.org/685258 Package-Manager: Portage-2.3.62-prefix, Repoman-2.3.12 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>
-rw-r--r--app-misc/ca-certificates/Manifest3
-rw-r--r--app-misc/ca-certificates/ca-certificates-20190110.3.43.ebuild188
-rw-r--r--app-misc/ca-certificates/files/ca-certificates-20150426-root.patch49
-rw-r--r--app-misc/ca-certificates/metadata.xml14
-rw-r--r--app-misc/metadata.xml36
5 files changed, 290 insertions, 0 deletions
diff --git a/app-misc/ca-certificates/Manifest b/app-misc/ca-certificates/Manifest
new file mode 100644
index 0000000000..e38a2df15b
--- /dev/null
+++ b/app-misc/ca-certificates/Manifest
@@ -0,0 +1,3 @@
+DIST ca-certificates_20190110.tar.xz 243472 BLAKE2B b63e541fcf611712634f8c7fd2da5f189b999c39118047a7e2fd43ddd5e0fbefeaa08788363482a02be55a347447d4cc95f1505bf869accf9cd847578ad2e879 SHA512 9ce2661018edb120d0ef5bd3ed52c0f73f577d7607d135a31730549f5eb4176db4865cdb8bde77a78dc3efb8968846da5e72af8a833a9da2a8a7deb4f1560372
+DIST nss-3.43.tar.gz 23466026 BLAKE2B 1b43036daeedea1643a7fe1a8defa167097997efec529417c4857eaa29d453b6a588f462078f13662193d58dfd8f9566c22d729729591934ef154b9befb8f98d SHA512 e9dfba5bd6f68c5ab58fc7a6fa1b16a035be1b1b7c436cf787bdc99257c5f54c78d73d94d015bffd29420df19b2a2818166c68fe592dd7208ab5605344827fb5
+DIST nss-cacert-class1-class3.patch 22950 BLAKE2B 9d5e60df5f161a3c27c41e5a9419440a54f888eda454e3cde5ebe626d4075b65cf9938b5144d0fb022377f4bd415bff5e5c67d104409860aa9391b3eb8872c68 SHA512 a5aa740bf110a3f0262e3f1ef2fc739ac2b44f042e220039d48aee8e97cd764d5c10718220364f4098aba955882bd02cadb5481512388971a8290312f88a7df0
diff --git a/app-misc/ca-certificates/ca-certificates-20190110.3.43.ebuild b/app-misc/ca-certificates/ca-certificates-20190110.3.43.ebuild
new file mode 100644
index 0000000000..ba46020c55
--- /dev/null
+++ b/app-misc/ca-certificates/ca-certificates-20190110.3.43.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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_{5,6,7}} )
+
+inherit eutils python-any-r1
+
+if [[ ${PV} == *.* ]] ; then
+ # Compile from source ourselves.
+ PRECOMPILED=false
+ inherit eapi7-ver
+
+ DEB_VER=$(ver_cut 1)
+ NSS_VER=$(ver_cut 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="~ppc-aix ~x64-cygwin ~amd64-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`
+# no dedicated pkg_* dependencies, bug#660306
+MY_PKGINSTDEPS="
+ app-misc/c_rehash
+ sys-apps/debianutils"
+RDEPEND="${DEPEND}
+ !prefix-stack? ( ${MY_PKGINSTDEPS} )"
+DEPEND+=" prefix-stack? ( ${MY_PKGINSTDEPS} )"
+
+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}" || die
+ cd "image/${EPREFIX}" || die
+
+ ${PRECOMPILED} && unpacker_src_unpack
+}
+
+src_prepare() {
+ cd "image/${EPREFIX}" || die
+ if ! ${PRECOMPILED} ; then
+ mkdir -p usr/sbin || die
+ cp -p "${S}"/${PN}-${DEB_VER}/sbin/update-ca-certificates \
+ usr/sbin/ || die
+
+ if use cacert ; then
+ pushd "${S}"/nss-${NSS_VER} >/dev/null || die
+ eapply -p0 "${DISTDIR}"/nss-cacert-class1-class3.patch
+ popd >/dev/null || die
+ 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}-${DEB_VER}/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 \
+ || die
+ if use cacert ; then
+ mkdir -p "${c}"/cacert.org || die
+ 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}" || die
+ 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 ${PN}-${DEB_VER} || die
+ 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 0000000000..6e41ac39e8
--- /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 0000000000..f4cf8a2a01
--- /dev/null
+++ b/app-misc/ca-certificates/metadata.xml
@@ -0,0 +1,14 @@
+<?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>
+ </use>
+</pkgmetadata>
diff --git a/app-misc/metadata.xml b/app-misc/metadata.xml
new file mode 100644
index 0000000000..98bcf3dff2
--- /dev/null
+++ b/app-misc/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The app-misc category contains various miscellaneous application
+ packages which don't belong anywhere else.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie app-misc enthält verschiedenste Applikationen welche
+ keiner anderen Kategorie zugeordnet werden konnten.
+ </longdescription>
+ <longdescription lang="nl">
+ De app-misc categorie bevat applicaties die niet in een specifieke
+ categorie geplaatst konden worden.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm app-misc chứa các ứng dụng linh tinh, không thuộc
+ về nhóm nào cả.
+ </longdescription>
+ <longdescription lang="it">
+ La cateogria app-misc contiene varie applicazioni che non ricadono nelle altre categorie.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria app-misc contém vários pacotes de aplicações mistas
+ que não pertencem a outros lugares.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria app-misc zawiera wiele rozmaitych programów, które nie
+ pasowały do żadnej innej kategorii.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría app-misc contiene varios paquetes de aplicaciones
+ misceláneas que no pertenecen a ninguna otra categoría.
+ </longdescription>
+</catmetadata>
+