/[gentoo-x86]/app-misc/ca-certificates/ca-certificates-20130906.ebuild
Gentoo

Contents of /app-misc/ca-certificates/ca-certificates-20130906.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Thu Mar 27 00:49:50 2014 UTC (5 years, 6 months ago) by zerochaos
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
fix for bug #475352, remove broken symlinks

(Portage version: 2.2.8-r1/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key DD11F94A)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-misc/ca-certificates/ca-certificates-20130906.ebuild,v 1.11 2014/03/19 07:46:25 vapier Exp $
4
5 EAPI="4"
6
7 inherit eutils unpacker
8
9 DESCRIPTION="Common CA Certificates PEM files"
10 HOMEPAGE="http://packages.debian.org/sid/ca-certificates"
11 #NMU_PR="1"
12 SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
13
14 LICENSE="MPL-1.1"
15 SLOT="0"
16 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"
17 IUSE=""
18
19 # platforms like AIX don't have a good ar
20 DEPEND="kernel_AIX? ( app-arch/deb2targz )
21 !<sys-apps/portage-2.1.10.41"
22 # openssl: we run `c_rehash`
23 # debianutils: we run `run-parts`
24 RDEPEND="${DEPEND}
25 dev-libs/openssl
26 sys-apps/debianutils"
27
28 S=${WORKDIR}
29
30 pkg_setup() {
31 # For the conversion to having it in CONFIG_PROTECT_MASK,
32 # we need to tell users about it once manually first.
33 [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
34 || ewarn "You should run update-ca-certificates manually after etc-update"
35 }
36
37 src_unpack() {
38 if [[ -n ${EPREFIX} ]] ; then
39 # need to perform everything in the offset, #381937
40 mkdir -p "./${EPREFIX}"
41 cd "./${EPREFIX}" || die
42 fi
43 unpack_deb ${A}
44 }
45
46 src_prepare() {
47 cd "./${EPREFIX}" || die
48 epatch "${FILESDIR}"/${PN}-20110502-root.patch
49 local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
50 sed -i \
51 -e '/="$ROOT/s:ROOT/:ROOT'"${EPREFIX}"'/:' \
52 -e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
53 usr/sbin/update-ca-certificates || die
54 }
55
56 src_compile() {
57 (
58 echo "# Automatically generated by ${CATEGORY}/${PF}"
59 echo "# $(date -u)"
60 echo "# Do not edit."
61 cd "${S}${EPREFIX}"/usr/share/ca-certificates
62 find * -name '*.crt' | LC_ALL=C sort
63 ) > "${S}${EPREFIX}"/etc/ca-certificates.conf
64
65 sh "${S}${EPREFIX}"/usr/sbin/update-ca-certificates --root "${S}" || die
66 }
67
68 src_install() {
69 cp -pPR . "${D}"/ || die
70
71 mv "${ED}"/usr/share/doc/{ca-certificates,${PF}} || die
72
73 echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
74 doenvd 98ca-certificates
75 }
76
77 pkg_postinst() {
78 if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
79 # if the user has local certs, we need to rebuild again
80 # to include their stuff in the db.
81 # However it's too overzealous when the user has custom certs in place.
82 # --fresh is to clean up dangling symlinks
83 "${EROOT}"/usr/sbin/update-ca-certificates --root "${EROOT}"
84 fi
85
86 local c badcerts=0
87 for c in $(find -L "${EROOT}"etc/ssl/certs/ -type l) ; do
88 ewarn "Broken symlink for a certificate at $c"
89 badcerts=1
90 done
91 if [ $badcerts -eq 1 ]; then
92 ewarn "You MUST remove the above broken symlinks"
93 ewarn "Otherwise any SSL validation that use the directory may fail!"
94 ewarn "To batch-remove them, run:"
95 ewarn "find -L ${EROOT}etc/ssl/certs/ -type l -exec rm {} +"
96 fi
97 }

  ViewVC Help
Powered by ViewVC 1.1.20