1 require af-main_${PV}.inc
3 # NOTE: using libcap-native and setcap in install doesn't work
4 # NOTE: maybe setting afm_name to agl-framework is cleaner but has implications
5 # NOTE: there is a hack of security for using groups and dbus (to be checked)
6 # NOTE: using ZIP programs creates directories with mode 777 (very bad)
8 inherit cmake pkgconfig useradd systemd
9 BBCLASSEXTEND = "native"
13 DEPENDS = "openssl libxml2 xmlsec1 systemd libzip json-c systemd security-manager af-binder"
14 DEPENDS_class-native = "openssl libxml2 xmlsec1 libzip json-c"
15 RDEPENDS_${PN}_class-target += "af-binder-tools"
17 PACKAGE_WRITE_DEPS_append_with-lsm-smack = " smack-native libcap-native"
19 EXTRA_OECMAKE_class-native = "\
23 -Dafm_name=${afm_name} \
24 -Dafm_confdir=${afm_confdir} \
25 -Dafm_datadir=${afm_datadir} \
32 -Dafm_name=${afm_name} \
33 -Dafm_confdir=${afm_confdir} \
34 -Dafm_datadir=${afm_datadir} \
35 -Dsystemd_units_root=${systemd_units_root} \
36 -DUNITDIR_USER=${systemd_user_unitdir} \
37 -DUNITDIR_SYSTEM=${systemd_system_unitdir} \
40 # ------------------------ WARNING WARNING WARNNING ---------------------------
42 # ATM (FF.rc2), forcing all apps to be signed is an issue when building without
43 # agl-devel feature. A workaround is to define ALLOW_NO_SIGNATURE=ON for all
44 # builds but this must be removed later. See SPEC-1614 for more details.
46 # A variable AGL_FORBID_UNSIGNED_APPS is introduced to enable/disable this
47 # workaround in local.conf and allow transition to signed apps:
48 # * forbid unsigned apps by setting: AGL_FORBID_UNSIGNED_APPS="1"
49 # * [DEFAULT] allow unsigned apps: do nothing (or set: AGL_FORBID_UNSIGNED_APPS="0")
50 AGL_FORBID_UNSIGNED_APPS ?= "0"
53 EXTRA_OECMAKE_append_agl-devel = " -DAGL_DEVEL=1"
54 EXTRA_OECMAKE_append = " ${@bb.utils.contains('AGL_FORBID_UNSIGNED_APPS','1','','-DALLOW_NO_SIGNATURE=ON', d)}"
56 # Correct version (IMPORTANT TODO: to be restored later):
57 #EXTRA_OECMAKE_append_agl-devel = " -DAGL_DEVEL=1 -DALLOW_NO_SIGNATURE=ON"
59 # ------------------------ WARNING WARNING WARNNING ---------------------------
62 USERADD_PACKAGES = "${PN}"
63 USERADD_PARAM_${PN} = "-g ${afm_name} -d ${afm_datadir} -r ${afm_name}"
64 GROUPADD_PARAM_${PN} = "-r ${afm_name}"
67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/afm-user-daemon.service', '', d)} \
69 RDEPENDS_${PN}_append_with-lsm-smack = " smack bash"
70 DEPENDS_append_with-lsm-smack = " smack-native"
74 file://Hack-to-allow-the-debugging.patch \
77 do_install_append_class-target() {
78 install -d ${D}${bindir}
79 install -d -m 0775 ${D}${systemd_units_root}/system
80 install -d -m 0775 "${D}${systemd_units_root}/system/afm-user-session@.target.wants"
81 install -d -m 0775 ${D}${systemd_units_root}/user
82 install -d -m 0775 ${D}${systemd_units_root}/user/default.target.wants
83 install -d -m 0775 ${D}${systemd_units_root}/user/sockets.target.wants
84 install -d ${D}${afm_datadir}/applications
85 install -d ${D}${afm_datadir}/icons
86 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
87 install -d -m 0755 ${D}${systemd_user_unitdir}/default.target.wants
88 ln -s ../afm-user-daemon.service ${D}${systemd_user_unitdir}/default.target.wants/afm-user-daemon.service
89 ln -s ../afm-user-session.service ${D}${systemd_user_unitdir}/default.target.wants/afm-user-session.service
90 install -d -m 0755 ${D}${systemd_system_unitdir}/multi-user.target.wants
91 install -d -m 0755 ${D}${systemd_system_unitdir}/sockets.target.wants
92 ln -sf ../afm-system-setup.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-system-setup.service
93 ln -sf ../afm-system-daemon.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-system-daemon.service
94 ln -sf ../afm-system-daemon.socket ${D}${systemd_system_unitdir}/sockets.target.wants/afm-system-daemon.socket
96 echo "QT_WAYLAND_SHELL_INTEGRATION=ivi-shell" > ${D}${afm_confdir}/unit.env.d/qt-for-ivi-shell
99 do_install_append_porter() {
100 echo "LD_PRELOAD=/usr/lib/libEGL.so" > ${D}${afm_confdir}/unit.env.d/preload-libEGL
103 pkg_postinst_${PN}() {
104 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
105 chgrp ${afm_name} $D${systemd_units_root}/system
106 chgrp ${afm_name} $D${systemd_units_root}/system/afm-user-session@.target.wants
107 chgrp ${afm_name} $D${systemd_units_root}/user/default.target.wants
108 chgrp ${afm_name} $D${systemd_units_root}/user/sockets.target.wants
110 chown ${afm_name}:${afm_name} $D${afm_datadir}
111 chown ${afm_name}:${afm_name} $D${afm_datadir}/applications
112 chown ${afm_name}:${afm_name} $D${afm_datadir}/icons
115 pkg_postinst_${PN}_append_with-lsm-smack() {
116 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
117 chsmack -a 'System::Shared' -t $D${systemd_units_root}/system
118 chsmack -a 'System::Shared' -t $D${systemd_units_root}/system/afm-user-session@.target.wants
119 chsmack -a 'System::Shared' -t $D${systemd_units_root}/user/default.target.wants
120 chsmack -a 'System::Shared' -t $D${systemd_units_root}/user/sockets.target.wants
122 chsmack -a 'System::Shared' -t $D${afm_datadir}
123 chsmack -a 'System::Shared' -t $D${afm_datadir}/applications
124 chsmack -a 'System::Shared' -t $D${afm_datadir}/icons
126 FILES_${PN} += "${systemd_units_root}/* ${systemd_system_unitdir} ${systemd_user_unitdir}"
128 PACKAGES =+ "${PN}-binding ${PN}-binding-dbg"
129 FILES_${PN}-binding = " ${afb_binding_dir}/afm-main-binding.so "
130 FILES_${PN}-binding-dbg = " ${afb_binding_dir}/.debug/afm-main-binding.so "
132 PACKAGES =+ "${PN}-tools ${PN}-tools-dbg"
133 FILES_${PN}-tools = "${bindir}/wgtpkg-*"
134 FILES_${PN}-tools-dbg = "${bindir}/.debug/wgtpkg-*"