blob: ce3cb217a1b705b2cf6a6447f951739d4bca46fb [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Common CA certificates"
2DESCRIPTION = "This package includes PEM files of CA certificates to allow \
3SSL-based applications to check for the authenticity of SSL connections. \
4This derived from Debian's CA Certificates."
5HOMEPAGE = "http://packages.debian.org/sid/ca-certificates"
6SECTION = "misc"
7LICENSE = "GPL-2.0+ & MPL-2.0"
8LIC_FILES_CHKSUM = "file://debian/copyright;md5=aeb420429b1659507e0a5a1b123e8308"
9
10# This is needed to ensure we can run the postinst at image creation time
11DEPENDS = ""
12DEPENDS_class-native = "openssl-native"
13DEPENDS_class-nativesdk = "openssl-native"
Brad Bishop19323692019-04-05 15:28:33 -040014# Need rehash from openssl and run-parts from debianutils
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015PACKAGE_WRITE_DEPS += "openssl-native debianutils-native"
16
Brad Bishopf8caae32019-03-25 13:13:56 -040017SRCREV = "c28799b138b044c963d24c4a69659b6e5486e3be"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018
19SRC_URI = "git://salsa.debian.org/debian/ca-certificates.git;protocol=https \
20 file://0002-update-ca-certificates-use-SYSROOT.patch \
21 file://0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch \
22 file://update-ca-certificates-support-Toybox.patch \
23 file://default-sysroot.patch \
24 file://sbindir.patch \
25 file://0003-update-ca-certificates-use-relative-symlinks-from-ET.patch \
Brad Bishop79641f22019-09-10 07:20:22 -040026 file://0001-certdata2pem.py-use-python3.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027 "
28
29S = "${WORKDIR}/git"
30
31inherit allarch
32
33EXTRA_OEMAKE = "\
34 'CERTSDIR=${datadir}/ca-certificates' \
35 'SBINDIR=${sbindir}' \
36"
37
38do_compile_prepend() {
39 oe_runmake clean
40}
41
42do_install () {
43 install -d ${D}${datadir}/ca-certificates \
44 ${D}${sysconfdir}/ssl/certs \
45 ${D}${sysconfdir}/ca-certificates/update.d
46 oe_runmake 'DESTDIR=${D}' install
47
48 install -d ${D}${mandir}/man8
49 install -m 0644 sbin/update-ca-certificates.8 ${D}${mandir}/man8/
50
51 install -d ${D}${sysconfdir}
52 {
53 echo "# Lines starting with # will be ignored"
54 echo "# Lines starting with ! will remove certificate on next update"
55 echo "#"
56 find ${D}${datadir}/ca-certificates -type f -name '*.crt' | \
Brad Bishop79641f22019-09-10 07:20:22 -040057 sed 's,^${D}${datadir}/ca-certificates/,,' | sort
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058 } >${D}${sysconfdir}/ca-certificates.conf
59}
60
61do_install_append_class-target () {
62 sed -i -e 's,/etc/,${sysconfdir}/,' \
63 -e 's,/usr/share/,${datadir}/,' \
64 -e 's,/usr/local,${prefix}/local,' \
65 ${D}${sbindir}/update-ca-certificates \
66 ${D}${mandir}/man8/update-ca-certificates.8
67}
68
69pkg_postinst_${PN}_class-target () {
70 SYSROOT="$D" $D${sbindir}/update-ca-certificates
71}
72
73CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
74
75# Rather than make a postinst script that works for both target and nativesdk,
76# we just run update-ca-certificate from do_install() for nativesdk.
77CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
78do_install_append_class-nativesdk () {
79 SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates
80}
81
82do_install_append_class-native () {
83 SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
84}
85
Brad Bishop15ae2502019-06-18 21:44:24 -040086RDEPENDS_${PN}_class-target = "openssl-bin"
87RDEPENDS_${PN}_class-native = "openssl-native"
88RDEPENDS_${PN}_class-nativesdk = "nativesdk-openssl-bin"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080089
90BBCLASSEXTEND = "native nativesdk"