Update recipes for transition to UNPACKDIR
[AGL/meta-agl-demo.git] / recipes-connectivity / kuksa-val / kuksa-certificates-agl.bb
1 SUMMARY = "AGL certificates for KUKSA.val, the KUKSA Vehicle Abstraction Layer"
2 HOMEPAGE = "https://github.com/eclipse/kuksa.val"
3 BUGTRACKER = "https://github.com/eclipse/kuksa.val/issues"
4
5 LICENSE = "MIT"
6 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
7
8 SRC_URI = "file://CA.pem \
9            file://Client.key \
10            file://Client.pem \
11            file://Server.key \
12            file://Server.pem \
13            file://jwt.key.pub \
14 "
15
16 S = "${WORKDIR}/sources"
17 UNPACKDIR = "${S}"
18
19 inherit allarch useradd
20
21 USERADD_PACKAGES = "${PN}-server"
22 USERADDEXTENSION = "useradd-staticids"
23 GROUPADD_PARAM:${PN}-server = "-g 900 kuksa ;"
24
25 do_install() {
26     # Install replacement CA certificate, server key + certificate,
27     # and client key + certificate.
28     # These are AGL specific versions generated using a tweaked
29     # genCerts.sh script to have different expiry dates than the
30     # upstream defaults, and use AGL as the organization.
31     install -d ${D}${sysconfdir}/kuksa-val/
32     install -m 0644 ${UNPACKDIR}/CA.pem ${D}${sysconfdir}/kuksa-val/
33     install -m 0640 -g 900 ${UNPACKDIR}/Server.key ${D}${sysconfdir}/kuksa-val/
34     install -m 0640 -g 900 ${UNPACKDIR}/Server.pem ${D}${sysconfdir}/kuksa-val/
35     install -m 0644 -g 900 ${UNPACKDIR}/jwt.key.pub ${D}${sysconfdir}/kuksa-val/
36     install -m 0644 ${UNPACKDIR}/Client.key ${D}${sysconfdir}/kuksa-val/
37     install -m 0644 ${UNPACKDIR}/Client.pem ${D}${sysconfdir}/kuksa-val/
38 }
39
40 PACKAGE_BEFORE_PN += "${PN}-ca ${PN}-server ${PN}-client"
41
42 FILES:${PN}-ca = " \
43     ${sysconfdir}/kuksa-val/CA.pem \
44 "
45 RPROVIDES:${PN}-ca += "kuksa-val-certificates-ca"
46
47 FILES:${PN}-server = " \
48     ${sysconfdir}/kuksa-val/Server.key \
49     ${sysconfdir}/kuksa-val/Server.pem \
50     ${sysconfdir}/kuksa-val/jwt.key.pub \
51 "
52 RPROVIDES:${PN}-server += "kuksa-val-certificates-server"
53 RDEPENDS:${PN}-server += "${PN}-ca"
54
55 FILES:${PN}-client = " \
56     ${sysconfdir}/kuksa-val/Client.key \
57     ${sysconfdir}/kuksa-val/Client.pem \
58 "
59 RPROVIDES:${PN}-client += "kuksa-val-certificates-client"
60 RDEPENDS:${PN}-client += "${PN}-ca"
61
62 ALLOW_EMPTY:${PN} = "1"
63
64 RDEPENDS:${PN} += "${PN}-ca ${PN}-server ${PN}-client"