af-main: Sign widgets when agl-devel
[AGL/meta-agl.git] / meta-app-framework / recipes-core / af-main / af-main_git.bb
index 0418162..e5a183a 100644 (file)
@@ -10,13 +10,13 @@ BBCLASSEXTEND = "native"
 
 SECTION = "base"
 
-DEPENDS = "openssl libxml2 xmlsec1 systemd libzip json-c systemd security-manager af-binder"
+DEPENDS = "openssl libxml2 xmlsec1 systemd libzip json-c systemd security-manager af-binder sed m4"
 DEPENDS_class-native = "openssl libxml2 xmlsec1 libzip json-c"
-RDEPENDS_${PN}_class-target += "af-binder-tools"
+RDEPENDS_${PN}_class-target += "af-binder-tools nss-localuser cynagoauth"
 
 PACKAGE_WRITE_DEPS_append_with-lsm-smack = " smack-native libcap-native"
 
-EXTRA_OECMAKE_class-native  = "\
+EXTRA_OECMAKE_append_class-native  = "\
        -DUSE_LIBZIP=1 \
        -DUSE_SIMULATION=1 \
        -DUSE_SDK=1 \
@@ -26,7 +26,7 @@ EXTRA_OECMAKE_class-native  = "\
        -Dafm_datadir=${afm_datadir} \
 "
 
-EXTRA_OECMAKE = "\
+EXTRA_OECMAKE_append_class-target = "\
        -DUSE_LIBZIP=1 \
        -DUSE_SIMULATION=0 \
        -DUSE_SDK=0 \
@@ -62,23 +62,16 @@ EXTRA_OECMAKE_append = " ${@bb.utils.contains('AGL_FORBID_UNSIGNED_APPS','1','',
 
 
 USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "-g ${afm_name} -d ${afm_datadir} -r ${afm_name}"
-GROUPADD_PARAM_${PN} = "-r ${afm_name}"
+USERADD_PARAM_${PN} = "--system --gid ${afm_name} --home-dir ${afm_datadir} ${afm_name}"
+GROUPADD_PARAM_${PN} = "--system ${afm_name}"
 
-FILES_${PN} += "\
-       ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/afm-user-daemon.service', '', d)} \
-"
 RDEPENDS_${PN}_append_with-lsm-smack = " smack bash"
 DEPENDS_append_with-lsm-smack = " smack-native"
 
-# short hacks here
-SRC_URI += "\
-       file://Hack-to-allow-the-debugging.patch \
-"
-
 do_install_append_class-target() {
     install -d ${D}${bindir}
     install -d -m 0775 ${D}${systemd_units_root}/system
+    install -d -m 0775 "${D}${systemd_units_root}/system/multi-user.target.wants"
     install -d -m 0775 "${D}${systemd_units_root}/system/afm-user-session@.target.wants"
     install -d -m 0775 ${D}${systemd_units_root}/user
     install -d -m 0775 ${D}${systemd_units_root}/user/default.target.wants
@@ -86,19 +79,18 @@ do_install_append_class-target() {
     install -d ${D}${afm_datadir}/applications
     install -d ${D}${afm_datadir}/icons
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d -m 0755 ${D}${systemd_user_unitdir}/default.target.wants
-        ln -s ../afm-user-daemon.service ${D}${systemd_user_unitdir}/default.target.wants/afm-user-daemon.service
-        ln -s ../afm-user-session.service ${D}${systemd_user_unitdir}/default.target.wants/afm-user-session.service
         install -d -m 0755 ${D}${systemd_system_unitdir}/multi-user.target.wants
         install -d -m 0755 ${D}${systemd_system_unitdir}/sockets.target.wants
         ln -sf ../afm-system-setup.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-system-setup.service
         ln -sf ../afm-system-daemon.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-system-daemon.service
         ln -sf ../afm-system-daemon.socket ${D}${systemd_system_unitdir}/sockets.target.wants/afm-system-daemon.socket
     fi
-    echo "QT_WAYLAND_SHELL_INTEGRATION=ivi-shell" > ${D}${afm_confdir}/unit.env.d/qt-for-ivi-shell
+
+    DEFAULT_WM_SHELL="${@bb.utils.contains('DISTRO_FEATURES', 'agl-compositor', 'xdg-shell-v6', 'ivi-shell', d)}"
+    echo "QT_WAYLAND_SHELL_INTEGRATION=${DEFAULT_WM_SHELL}" > ${D}${afm_confdir}/unit.env.d/qt-shell
 }
 
-pkg_postinst_${PN}() {
+pkg_postinst_ontarget_${PN}() {
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         chgrp ${afm_name} $D${systemd_units_root}/system
         chgrp ${afm_name} $D${systemd_units_root}/system/afm-user-session@.target.wants
@@ -110,7 +102,7 @@ pkg_postinst_${PN}() {
     chown ${afm_name}:${afm_name} $D${afm_datadir}/icons
 }
 
-pkg_postinst_${PN}_append_with-lsm-smack() {
+pkg_postinst_ontarget_${PN}_append_with-lsm-smack() {
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         chsmack -a 'System::Shared' -t $D${systemd_units_root}/system
         chsmack -a 'System::Shared' -t $D${systemd_units_root}/system/afm-user-session@.target.wants
@@ -122,6 +114,7 @@ pkg_postinst_${PN}_append_with-lsm-smack() {
     chsmack -a 'System::Shared' -t $D${afm_datadir}/icons
 }
 FILES_${PN} += "${systemd_units_root}/* ${systemd_system_unitdir} ${systemd_user_unitdir}"
+FILES_${PN}_append_agl-sign-wgts = " ${datadir}/afm"
 
 PACKAGES =+ "${PN}-binding ${PN}-binding-dbg"
 FILES_${PN}-binding = " ${afb_binding_dir}/afm-main-binding.so "