22f52c4ec636e4f8b14055683d834991001c671c
[AGL/meta-agl.git] / meta-agl / recipes-config / agl-login-manager / agl-login-manager_0.1.bb
1 SUMMARY = "AGL Login manager"
2
3 LICENSE = "MIT"
4 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6 inherit agl-graphical
7
8 SRC_URI += " \
9     file://user-config.service \
10     file://user-config.path \
11 "
12
13 LOGIN_USER ??="1001 1002"
14
15 RDEPENDS_${PN} += "af-main"
16
17 do_install_append() {
18
19     install -d ${D}${systemd_user_unitdir}/default.target.wants
20     install -m 0644 ${WORKDIR}/user-config.service ${D}${systemd_user_unitdir}
21     install -m 0644 ${WORKDIR}/user-config.path ${D}${systemd_user_unitdir}
22
23     sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
24         -i ${D}${systemd_user_unitdir}/user-config.service
25     sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
26         -i ${D}${systemd_user_unitdir}/user-config.path
27
28     ln -s ../user-config.path ${D}${systemd_user_unitdir}/default.target.wants/user-config.path
29
30     install -d ${D}${systemd_system_unitdir}/multi-user.target.wants/
31
32     for AGL_USER in ${LOGIN_USER};do
33         ln -s ../afm-user-session@.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-user-session@${AGL_USER}.service
34     done
35 }
36
37 FILES_${PN} += "${systemd_user_unitdir} ${systemd_system_unitdir}"