meta-agl-bsp: Add reference hardware GPS support
[AGL/meta-agl.git] / meta-agl-bsp / meta-agl-refhw-gen3 / recipes-navigation / gpsd / gpsd-conf-refhw_1.0.bb
1 SUMMARY = "AGL Reference Hardware specific gpsd configuration"
2 LICENSE = "MIT"
3 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
4
5 COMPATIBLE_MACHINE = "agl-refhw-h3"
6 PACKAGE_ARCH = "${MACHINE_ARCH}"
7
8 SRC_URI = "file://gpsd.refhw \
9            file://refhw-gpsd-helper.sh \
10            file://refhw.conf \
11 "
12
13 inherit update-alternatives
14
15 do_configure[noexec] = "1"
16 do_compile[noexec] = "1"
17
18 do_install() {
19     install -D -m 0644 ${WORKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw
20     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
21         install -D -m 0755 ${WORKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh
22         install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d
23         install -D -m 0644 ${WORKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf
24     fi
25 }
26
27 ALTERNATIVE_${PN} = "gpsd-defaults"
28 ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
29 ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.refhw"
30 # NOTE: Priority needs to be below default of 10 to avoid overriding the
31 #       default configuration.  The script run by the systemd drop-in
32 #       will tweak things on boot to handle h3ulcb vs refhw.
33 ALTERNATIVE_PRIORITY[gpsd-defaults] = "5"
34
35 CONFFILES_${PN} = "${sysconfdir}/default/gpsd.refhw"
36
37 # NOTE: Explicitly not defining RPROVIDES of "virtual/gpsd-conf" to
38 #       avoid conflicting with the default configuration and potentially
39 #       changing behavior on m3ulcb/h3ulcb.