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

Contents of /app-misc/ca-certificates/ca-certificates-20110502-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Sep 7 16:31:55 2011 UTC (3 years, 1 month ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
Fix compilation on platforms where /bin/sh is bourne, but not POSIX shell (e.g. Solaris, AIX, etc.)

(Portage version: 2.2.01.19120-prefix/cvs/SunOS sparc)

1 # Copyright 1999-2011 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-20110502-r4.ebuild,v 1.2 2011/09/07 07:04:06 grobian Exp $
4
5 EAPI="3"
6
7 inherit eutils
8
9 DESCRIPTION="Common CA Certificates PEM files"
10 HOMEPAGE="http://packages.debian.org/sid/ca-certificates"
11 SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}+nmu1_all.deb"
12
13 LICENSE="MPL-1.1"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
16 IUSE=""
17
18 # platforms like AIX don't have a good ar
19 DEPEND="kernel_AIX? ( app-arch/deb2targz )"
20 # openssl: we run `c_rehash`
21 # debianutils: we run `run-parts`
22 RDEPEND="${DEPEND}
23 dev-libs/openssl
24 sys-apps/debianutils"
25
26 S=${WORKDIR}
27
28 pkg_setup() {
29 # For the conversion to having it in CONFIG_PROTECT_MASK,
30 # we need to tell users about it once manually first.
31 [[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
32 || ewarn "You should run update-ca-certificates manually after etc-update"
33 }
34
35 src_unpack() {
36 if [[ -n ${EPREFIX} ]] ; then
37 # need to perform everything in the offset, #381937
38 mkdir -p "./${EPREFIX}"
39 cd "./${EPREFIX}" || die
40 fi
41 unpack ${A}
42 unpack ./data.tar.gz
43 rm -f control.tar.gz data.tar.gz debian-binary
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 prepalldocs
73
74 echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
75 doenvd 98ca-certificates
76 }
77
78 pkg_postinst() {
79 if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
80 # if the user has local certs, we need to rebuild again
81 # to include their stuff in the db.
82 # However it's too overzealous when the user has custom certs in place.
83 # --fresh is to clean up dangling symlinks
84 "${EROOT}"/usr/sbin/update-ca-certificates --root "${EROOT}"
85 fi
86
87 local c badcerts=0
88 for c in $(find -L "${EROOT}"etc/ssl/certs/ -type l) ; do
89 ewarn "Broken symlink for a certificate at $c"
90 badcerts=1
91 done
92 if [ $badcerts -eq 1 ]; then
93 ewarn "You MUST remove the above broken symlinks"
94 ewarn "Otherwise any SSL validation that use the directory may fail!"
95 ewarn "To batch-remove them, run:"
96 ewarn "find -L ${EROOT}etc/ssl/certs/ -type l -exec rm {} +"
97 fi
98 }

  ViewVC Help
Powered by ViewVC 1.1.20