Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/ca-certificates/
Date: Wed, 05 Oct 2016 07:54:04
Message-Id: 1475654031.b213d00de62b3a398c1e32faa467a7c616aad879.polynomial-c@gentoo
1 commit: b213d00de62b3a398c1e32faa467a7c616aad879
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 5 07:52:44 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 5 07:53:51 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b213d00d
7
8 app-misc/ca-certificates: Bump to version 20160104.3.27.1
9
10 Package-Manager: portage-2.3.1
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 app-misc/ca-certificates/Manifest | 1 +
14 .../ca-certificates-20160104.3.27.1.ebuild | 176 +++++++++++++++++++++
15 2 files changed, 177 insertions(+)
16
17 diff --git a/app-misc/ca-certificates/Manifest b/app-misc/ca-certificates/Manifest
18 index d684d14..4085aca 100644
19 --- a/app-misc/ca-certificates/Manifest
20 +++ b/app-misc/ca-certificates/Manifest
21 @@ -3,3 +3,4 @@ DIST ca-certificates_20160104.tar.xz 293632 SHA256 09eb770122e23260316120c0cbbdd
22 DIST nss-3.14.1-add_spi+cacerts_ca_certs.patch 25018 SHA256 82ca25982828fd7153ad15fc6e81408c115476eeeb4045d3a71469380b56824b SHA512 2aafbd972b073061bfd66a66a4b50060691957f2910f716f7a69d22d655c499f186f05db2101bea5248a00949f339327ba8bfffec024c61c8ee908766201ae00 WHIRLPOOL c9fe397e316dac7983b187acf7227078ebd8f8da5df53f77f2564489e85f123c4d2afb88d56e8dc14b9ebfffe8a71ade4724b3c1ea683c5c4c487cb3a64eda43
23 DIST nss-3.21.tar.gz 6978112 SHA256 3f7a5b027d7cdd5c0e4ff7544da33fdc6f56c2f8c27fff02938fd4a6fbe87239 SHA512 0645465b5d1ab05d819355a3f4a2879499539a00d95bfab3ca14a7dcd901e510b5d9ae797386ff5a42f68b0b57f7bbec4ec9d3a85ebd508eb824aba1fb589d53 WHIRLPOOL 7504d83de606d61840e06cb855ea688eb022d5eef062bcb7ac4d1064db96b96e35ae4ce0aff9d389a2140a7c3b974aaa9a86ada52af1199d462fdb48b11b42e4
24 DIST nss-3.23.tar.gz 7467001 SHA256 94b383e31c9671e9dfcca81084a8a813817e8f05a57f54533509b318d26e11cf SHA512 f3e388a415493685faa6df932e9e968af41ea2e8e4cba3fbd539c60177443e4042e8d2e2bfe74183552e14522d49048be2f80fbe038bdbd499971e82abf2cc32 WHIRLPOOL 77e22bd7a525c5b10723e1d5fb6db1e9d2efebfcdf9828aa79296f71c441c065201ecda56291f37790333d9b1d1e38fef1391a033382a885b83da31a646d6243
25 +DIST nss-3.27.1.tar.gz 7397737 SHA256 fd3637a1930cd838239a89633a7ed9a18859ae9b599043f3a18f726dc4ec2a6b SHA512 b52bc18e42cab78a325a8c4fcf2894ca879cecbb657a852baf460551ed9727f145bc328ebb61a43a1605b457f923a1495707ac4aee27be70220463818ed8db8d WHIRLPOOL 17174b7d43bd82b9e805d653a7ea8b79bc2647a5891806c1cb77e2ac99e40eb64ffee03e105a41c375ba37e26cafeff4bd4bad27c48e94ed388d0215d0545364
26
27 diff --git a/app-misc/ca-certificates/ca-certificates-20160104.3.27.1.ebuild b/app-misc/ca-certificates/ca-certificates-20160104.3.27.1.ebuild
28 new file mode 100644
29 index 00000000..d256d7c
30 --- /dev/null
31 +++ b/app-misc/ca-certificates/ca-certificates-20160104.3.27.1.ebuild
32 @@ -0,0 +1,176 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +# The Debian ca-certificates package merely takes the CA database as it exists
38 +# in the nss package and repackages it for use by openssl.
39 +#
40 +# The issue with using the compiled debs directly is two fold:
41 +# - they do not update frequently enough for us to rely on them
42 +# - they pull the CA database from nss tip of tree rather than the release
43 +#
44 +# So we take the Debian source tools and combine them with the latest nss
45 +# release to produce (largely) the same end result. The difference is that
46 +# now we know our cert database is kept in sync with nss and, if need be,
47 +# can be sync with nss tip of tree more frequently to respond to bugs.
48 +
49 +# When triaging bugs from users, here's some handy tips:
50 +# - To see what cert is hitting errors, use openssl:
51 +# openssl s_client -port 443 -CApath /etc/ssl/certs/ -host $HOSTNAME
52 +# Focus on the errors written to stderr.
53 +#
54 +# - Look at the upstream log as to why certs were added/removed:
55 +# https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
56 +#
57 +# - If people want to add/remove certs, tell them to file w/mozilla:
58 +# https://bugzilla.mozilla.org/enter_bug.cgi?product=NSS&component=CA%20Certificates&version=trunk
59 +
60 +EAPI="5"
61 +PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
62 +
63 +inherit eutils python-any-r1
64 +
65 +if [[ ${PV} == *.* ]] ; then
66 + # Compile from source ourselves.
67 + PRECOMPILED=false
68 + inherit versionator
69 +
70 + DEB_VER=$(get_version_component_range 1)
71 + NSS_VER=$(get_version_component_range 2-)
72 + RTM_NAME="NSS_${NSS_VER//./_}_RTM"
73 +else
74 + # Debian precompiled version.
75 + PRECOMPILED=true
76 + inherit unpacker
77 +fi
78 +
79 +DESCRIPTION="Common CA Certificates PEM files"
80 +HOMEPAGE="http://packages.debian.org/sid/ca-certificates"
81 +NMU_PR=""
82 +if ${PRECOMPILED} ; then
83 + SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
84 +else
85 + SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${DEB_VER}${NMU_PR:++nmu}${NMU_PR}.tar.xz
86 + ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${RTM_NAME}/src/nss-${NSS_VER}.tar.gz
87 + cacert? ( https://dev.gentoo.org/~anarchy/patches/nss-3.14.1-add_spi+cacerts_ca_certs.patch )"
88 +fi
89 +
90 +LICENSE="MPL-1.1"
91 +SLOT="0"
92 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
93 +IUSE=""
94 +${PRECOMPILED} || IUSE+=" +cacert"
95 +
96 +DEPEND=""
97 +if ${PRECOMPILED} ; then
98 + DEPEND+=" !<sys-apps/portage-2.1.10.41"
99 +fi
100 +# c_rehash: we run `c_rehash`
101 +# debianutils: we run `run-parts`
102 +RDEPEND="${DEPEND}
103 + app-misc/c_rehash
104 + sys-apps/debianutils"
105 +
106 +if ! ${PRECOMPILED}; then
107 + DEPEND+=" ${PYTHON_DEPS}"
108 +fi
109 +
110 +S=${WORKDIR}
111 +
112 +pkg_setup() {
113 + # For the conversion to having it in CONFIG_PROTECT_MASK,
114 + # we need to tell users about it once manually first.
115 + [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
116 + || ewarn "You should run update-ca-certificates manually after etc-update"
117 +}
118 +
119 +src_unpack() {
120 + ${PRECOMPILED} || default
121 +
122 + # Do all the work in the image subdir to avoid conflicting with source
123 + # dirs in $WORKDIR. Need to perform everything in the offset #381937
124 + mkdir -p "image/${EPREFIX}"
125 + cd "image/${EPREFIX}" || die
126 +
127 + ${PRECOMPILED} && unpacker_src_unpack
128 +}
129 +
130 +src_prepare() {
131 + cd "image/${EPREFIX}" || die
132 + if ! ${PRECOMPILED} ; then
133 + mkdir -p usr/sbin
134 + cp -p "${S}"/${PN}/sbin/update-ca-certificates usr/sbin/ || die
135 +
136 + if use cacert ; then
137 + pushd "${S}"/nss-${NSS_VER} >/dev/null
138 + epatch "${DISTDIR}"/nss-3.14.1-add_spi+cacerts_ca_certs.patch
139 + popd >/dev/null
140 + fi
141 + fi
142 +
143 + epatch "${FILESDIR}"/${PN}-20150426-root.patch
144 + local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
145 + sed -i \
146 + -e '/="$ROOT/s:ROOT:ROOT'"${EPREFIX}"':' \
147 + -e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
148 + usr/sbin/update-ca-certificates || die
149 +}
150 +
151 +src_compile() {
152 + cd "image/${EPREFIX}" || die
153 + if ! ${PRECOMPILED} ; then
154 + python_setup
155 + local d="${S}/${PN}/mozilla"
156 + # Grab the database from the nss sources.
157 + cp "${S}"/nss-${NSS_VER}/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h} "${d}" || die
158 + emake -C "${d}"
159 +
160 + # Now move the files to the same places that the precompiled would.
161 + mkdir -p etc/ssl/certs etc/ca-certificates/update.d usr/share/ca-certificates/mozilla
162 + if use cacert ; then
163 + mkdir -p usr/share/ca-certificates/{cacert.org,spi-inc.org}
164 + mv "${d}"/CAcert_Inc..crt usr/share/ca-certificates/cacert.org/cacert.org_root.crt || die
165 + mv "${d}"/SPI_Inc..crt usr/share/ca-certificates/spi-inc.org/spi-cacert-2008.crt || die
166 + fi
167 + mv "${d}"/*.crt usr/share/ca-certificates/mozilla/ || die
168 + else
169 + mv usr/share/doc/{ca-certificates,${PF}} || die
170 + fi
171 +
172 + (
173 + echo "# Automatically generated by ${CATEGORY}/${PF}"
174 + echo "# $(date -u)"
175 + echo "# Do not edit."
176 + cd usr/share/ca-certificates
177 + find * -name '*.crt' | LC_ALL=C sort
178 + ) > etc/ca-certificates.conf
179 +
180 + sh usr/sbin/update-ca-certificates --root "${S}/image" || die
181 +}
182 +
183 +src_install() {
184 + cp -pPR image/* "${D}"/ || die
185 + if ! ${PRECOMPILED} ; then
186 + cd ca-certificates
187 + doman sbin/*.8
188 + dodoc debian/README.* examples/ca-certificates-local/README
189 + fi
190 +
191 + echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
192 + doenvd 98ca-certificates
193 +}
194 +
195 +pkg_postinst() {
196 + if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
197 + # if the user has local certs, we need to rebuild again
198 + # to include their stuff in the db.
199 + # However it's too overzealous when the user has custom certs in place.
200 + # --fresh is to clean up dangling symlinks
201 + "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
202 + fi
203 +
204 + if [ -n "$(find -L "${EROOT}"etc/ssl/certs/ -type l)" ] ; then
205 + ewarn "Removing the following broken symlinks:"
206 + ewarn "$(find -L "${EROOT}"/etc/ssl/certs/ -type l -printf '%p -> %l\n' -delete)"
207 + fi
208 +}