agl-demo: update meta-clang comment
[AGL/meta-agl-demo.git] / recipes-connectivity / kuksa-val / kuksa-val_git.bb
1 SUMMARY = "KUKSA.val, the KUKSA Vehicle Abstraction Layer"
2 DESCRIPTION = "KUKSA.val provides a COVESA VSS data model describing data in a vehicle."
3 HOMEPAGE = "https://github.com/eclipse/kuksa.val"
4 BUGTRACKER = "https://github.com/eclipse/kuksa.val/issues"
5
6 LICENSE = "Apache-2.0 & BSL-1.0 & MIT"
7 LIC_FILES_CHKSUM = "file://../LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9 \
8                     file://3rd-party-libs/jsoncons/LICENSE;md5=6ee7f7ed2001e4cde4679fdb8926f820 \
9                     file://3rd-party-libs/turtle/LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c \
10                     file://3rd-party-libs/jwt-cpp/LICENSE;md5=8325a5ce4414c65ffdda392e0d96a9ff"
11
12 DEPENDS = "boost openssl mosquitto protobuf-native grpc-native grpc"
13
14 require kuksa-val.inc
15
16 SRC_URI += "file://kuksa-val.service \
17             file://0001-Make-Boost-requirements-more-liberal.patch;patchdir=.. \
18             file://0002-Fix-gRPC-configuration-for-OE-cross-compiling.patch;patchdir=.. \
19             file://0003-Make-install-locations-configurable.patch;patchdir=.. \
20             file://0004-Disable-default-fetch-and-build-of-googletest.patch;patchdir=.. \
21             file://0005-kuksa-val-server-Add-missing-check_git-dependency.patch;patchdir=.. \
22             file://0006-kuksa-val-server-OverlayLoader-explicitly-include-fs.patch;patchdir=.. \
23 "
24
25 S = "${WORKDIR}/git/kuksa-val-server"
26
27 inherit cmake pkgconfig systemd useradd
28
29 SYSTEMD_SERVICE:${PN} = "kuksa-val.service"
30
31 USERADD_PACKAGES = "${PN} ${PN}-server-certificates"
32 USERADDEXTENSION = "useradd-staticids"
33 GROUPADD_PARAM:${PN} = "-g 900 kuksa ;"
34 USERADD_PARAM:${PN} = "--system -g 900 -u 900 -o -d / --shell /bin/nologin kuksa ;"
35 GROUPADD_PARAM:${PN}-server-certificates = "-g 900 kuksa ;"
36
37 # Configure file locations more along the lines of FHS instead of kuksa.val's
38 # default locations.
39 EXTRA_OECMAKE = " \
40     -DKUKSA_INSTALL_BINDIR=${bindir} \
41     -DKUKSA_INSTALL_CERTDIR=${sysconfdir}/kuksa-val \
42     -DKUKSA_INSTALL_DATADIR=${datadir}/kuksa-val \
43     -DKUKSA_INSTALL_CONFIGDIR=${sysconfdir}/kuksa-val \
44 "
45
46 do_install:append() {
47     # Lower the logging level used in the installed config.ini from the upstream
48     # default of "ALL", which spams the logs.
49     sed -i 's/^log-level = .*/log-level = WARNING/' ${D}/${sysconfdir}/kuksa-val/config.ini
50
51     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
52         install -d ${D}${systemd_system_unitdir}
53         install -m 0644 ${WORKDIR}/kuksa-val.service ${D}${systemd_system_unitdir}
54     fi
55 }
56
57 # Put certificates into their own packages so we can avoid duplicates
58 # of them for e.g. cluster clients, and so downstream users can
59 # replace them with their own certificates.
60 #
61 # NOTE:
62 #   Downstream users can replace these packages with alternates by
63 #   having their packages set their RPROVIDES to include the desired
64 #   kuksa-val-certificates-* and explicitly adding their package(s)
65 #   to an image, they will end up getting priority during rootfs
66 #   construction and installed instead of the default ones here.
67
68 PACKAGE_BEFORE_PN += "${PN}-certificates-ca ${PN}-certificates-server ${PN}-certificates-client"
69
70 FILES:${PN}-certificates-ca = " \
71     ${sysconfdir}/kuksa-val/CA.pem \
72 "
73
74 FILES:${PN}-certificates-server = " \
75     ${sysconfdir}/kuksa-val/Server.key \
76     ${sysconfdir}/kuksa-val/Server.pem \
77     ${sysconfdir}/kuksa-val/jwt.key.pub \
78 "
79 RDEPENDS:${PN}-certificates-server += "${PN}-certificates-ca"
80
81 FILES:${PN}-certificates-client = " \
82     ${sysconfdir}/kuksa-val/Client.key \
83     ${sysconfdir}/kuksa-val/Client.pem \
84 "
85 RDEPENDS:${PN}-certificate-clients += "${PN}-certificates-ca"
86
87 FILES:${PN} += "${systemd_system_unitdir} ${datadir}"
88
89 RDEPENDS:${PN} += "${PN}-certificates-server ${PN}-certificates-client"