Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "Common CA certificates" |
| 2 | DESCRIPTION = "This package includes PEM files of CA certificates to allow \ |
| 3 | SSL-based applications to check for the authenticity of SSL connections. \ |
| 4 | This derived from Debian's CA Certificates." |
| 5 | HOMEPAGE = "http://packages.debian.org/sid/ca-certificates" |
| 6 | SECTION = "misc" |
| 7 | LICENSE = "GPL-2.0+ & MPL-2.0" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 8 | LIC_FILES_CHKSUM = "file://debian/copyright;md5=ae5b36b514e3f12ce1aa8e2ee67f3d7e" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 9 | |
| 10 | # This is needed to ensure we can run the postinst at image creation time |
| 11 | DEPENDS = "" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 12 | DEPENDS:class-native = "openssl-native" |
| 13 | DEPENDS:class-nativesdk = "openssl-native" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 14 | # Need rehash from openssl and run-parts from debianutils |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | PACKAGE_WRITE_DEPS += "openssl-native debianutils-native" |
| 16 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 17 | SRCREV = "181be7ebd169b4a6fb5d90c3e6dc791e90534144" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 18 | |
| 19 | SRC_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 \ |
| 26 | " |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 27 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+)" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | |
| 29 | S = "${WORKDIR}/git" |
| 30 | |
| 31 | inherit allarch |
| 32 | |
| 33 | EXTRA_OEMAKE = "\ |
| 34 | 'CERTSDIR=${datadir}/ca-certificates' \ |
| 35 | 'SBINDIR=${sbindir}' \ |
| 36 | " |
| 37 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 38 | do_compile:prepend() { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | oe_runmake clean |
| 40 | } |
| 41 | |
| 42 | do_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 Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 57 | sed 's,^${D}${datadir}/ca-certificates/,,' | sort |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 58 | } >${D}${sysconfdir}/ca-certificates.conf |
| 59 | } |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | do_install:append:class-target () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | pkg_postinst:${PN}:class-target () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 70 | SYSROOT="$D" $D${sbindir}/update-ca-certificates |
| 71 | } |
| 72 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 73 | CONFFILES:${PN} += "${sysconfdir}/ca-certificates.conf" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | CONFFILES:${PN}:append:class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt" |
| 78 | do_install:append:class-nativesdk () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 79 | SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates |
| 80 | } |
| 81 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | do_install:append:class-native () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 83 | SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates |
| 84 | } |
| 85 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 86 | RDEPENDS:${PN}:append:class-target = " openssl-bin openssl" |
| 87 | RDEPENDS:${PN}:append:class-native = " openssl-native" |
| 88 | RDEPENDS:${PN}:append:class-nativesdk = " nativesdk-openssl-bin nativesdk-openssl" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 89 | |
| 90 | BBCLASSEXTEND = "native nativesdk" |