meta-app-framework: make applaunchd polkit dependency explicit
[AGL/meta-agl.git] / meta-app-framework / recipes-core / applaunchd / applaunchd_git.bb
index 2457b67..38d89b2 100644 (file)
@@ -8,21 +8,71 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984"
 DEPENDS = " \
     glib-2.0 \
     glib-2.0-native \
+    protobuf-native \
+    grpc-native \
+    grpc \
+    systemd \
 "
 
-PV      = "1.0+git${SRCPV}"
+PV = "2.0+git${SRCPV}"
 
 SRC_URI = " \
-        git://gerrit.automotivelinux.org/gerrit/src/applaunchd;protocol=https;branch=${AGL_BRANCH}  \
-        "
-SRCREV = "c84836ec5ddaf2d0e91c46713475c35652bb540f"
+    git://gerrit.automotivelinux.org/gerrit/src/applaunchd;protocol=https;branch=${AGL_BRANCH}  \
+    file://applaunchd.service \
+    file://agl-app@.service \
+    file://agl-app-web@.service \
+    file://agl-app-flutter@.service \
+    file://no-network.conf \
+    file://private-tmp.conf \
+"
+SRCREV = "7a3e870a8349d43a4838604db2c28140c2f76c9f"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig systemd useradd features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd polkit"
+
+USERADD_PACKAGES = "${PN}"
+USERADDEXTENSION = "useradd-staticids"
+GROUPADD_PARAM:${PN} = "-g 1003 applaunchd ; "
+USERADD_PARAM:${PN} = "\
+    -g 1003 -u 1003 -o -d / -K PASS_MAX_DAYS=-1 applaunchd ; \
+"
+
+SYSTEMD_SERVICE:${PN} = "applaunchd.service"
 
-S       = "${WORKDIR}/git"
+do_install:append() {
+    # Install generic template for all agl-app services
+    install -d ${D}${systemd_system_unitdir}
+    install -m 644 ${WORKDIR}/applaunchd.service ${D}${systemd_system_unitdir}/
+    install -m 644 ${WORKDIR}/agl-app@.service ${D}${systemd_system_unitdir}/
+    install -m 644 ${WORKDIR}/agl-app-web@.service ${D}${systemd_system_unitdir}/
+    install -m 644 ${WORKDIR}/agl-app-flutter@.service ${D}${systemd_system_unitdir}/
 
-inherit meson pkgconfig
+    # Install individual sandboxing overrides/drop-ins to be used by apps
+    install -d ${D}${systemd_system_unitdir}/sandboxing
+    install -m 644 ${WORKDIR}/no-network.conf ${D}${systemd_system_unitdir}/sandboxing/
+    install -m 644 ${WORKDIR}/private-tmp.conf ${D}${systemd_system_unitdir}/sandboxing/
+}
 
-FILES:${PN} += " ${datadir}/dbus-1/"
+PACKAGE_BEFORE_PN += "${PN}-template-agl-app ${PN}-template-agl-app-web ${PN}-template-agl-app-flutter"
+
+FILES:${PN} += "${systemd_system_unitdir}"
+
+FILES:${PN}-template-agl-app = "${systemd_system_unitdir}/agl-app@.service"
+
+FILES:${PN}-template-agl-app-web = "${systemd_system_unitdir}/agl-app-web@.service"
+
+FILES:${PN}-template-agl-app-flutter = "${systemd_system_unitdir}/agl-app-flutter@.service"
 
 RDEPENDS:${PN} += " \
-    agl-session \
+    agl-users \
+    polkit-rule-agl-app \
 "
+
+RDEPENDS:${PN}-template-agl-app = "${PN}"
+
+RDEPENDS:${PN}-template-agl-app-web = "${PN}"
+
+RDEPENDS:${PN}-template-agl-app-flutter = "${PN}"