c86838268d90202ac2fc6229f650952ab102f720
[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     file://agl-user-session.pamd \
12     file://agl-user-session@.service \
13 "
14
15 LOGIN_USER ??="agl-driver agl-passenger"
16
17 do_install_append() {
18
19     install -d ${D}${sysconfdir}/pam.d/
20     install -m 0644 ${WORKDIR}/agl-user-session.pamd ${D}${sysconfdir}/pam.d/agl-user-session
21
22     install -d ${D}${systemd_user_unitdir}
23     install -d ${D}${systemd_user_unitdir}/default.target.wants
24     install -m 0644 ${WORKDIR}/user-config.service ${D}${systemd_user_unitdir}
25     install -m 0644 ${WORKDIR}/user-config.path ${D}${systemd_user_unitdir}
26
27     sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
28         -i ${D}${systemd_user_unitdir}/user-config.service
29     sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
30         -i ${D}${systemd_user_unitdir}/user-config.path
31
32     ln -sf ${systemd_user_unitdir}/user-config.path ${D}${systemd_user_unitdir}/default.target.wants
33
34     install -d ${D}${systemd_unitdir}/system/
35     install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
36     install -m 0644 ${WORKDIR}/agl-user-session@.service ${D}${systemd_unitdir}/system/
37
38     for AGL_USER in ${LOGIN_USER};do
39         ln -sf ${systemd_system_unitdir}/agl-user-session@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/agl-user-session@${AGL_USER}.service;
40     done
41 }
42
43 FILES_${PN} += "${sysconfdir}/pam.d/agl-user-session"
44 FILES_${PN} += "${systemd_user_unitdir}/*"
45 FILES_${PN} += "${libdir}/systemd/user/default.target.wants/*"
46 FILES_${PN} += "${systemd_unitdir}/system/agl-user-session@.service"
47 FILES_${PN} += "${systemd_unitdir}/system/multi-user.target.wants/*"