meta-app-framework: add new agl-session recipe
[AGL/meta-agl.git] / meta-app-framework / recipes-config / agl-session / agl-session_0.1.bb
1 SUMMARY = "AGL user session"
2 LICENSE = "Apache-2.0"
3 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
4
5 SRC_URI = "\
6     file://agl-session@.service \
7     file://agl-session.target \
8 "
9
10 inherit systemd allarch useradd
11
12 USERADD_PACKAGES = "${PN}"
13 USERADDEXTENSION = "useradd-staticids"
14 GROUPADD_PARAM:${PN} = "\
15         -g 1001 agl-driver ; \
16 "
17 USERADD_PARAM:${PN} = "\
18   -g 1001 -u 1001 -o -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \
19 "
20
21 SYSTEMD_PACKAGES = "${PN}"
22 # Instantiate session for the 'agl-driver' user, so we don't have to hardcode
23 # the user name/ID in the service file itself
24 SYSTEMD_SERVICE:${PN} = "agl-session@agl-driver.service"
25 SYSTEMD_AUTO_ENABLE:${PN} = "enable"
26
27 do_install() {
28     install -d ${D}${systemd_system_unitdir}
29     install -m 0644 ${WORKDIR}/agl-session@.service ${D}${systemd_system_unitdir}
30
31     install -d ${D}${systemd_user_unitdir}
32     install -m 0644 ${WORKDIR}/agl-session.target ${D}${systemd_user_unitdir}
33 }
34
35 FILES:${PN} += "${systemd_system_unitdir} ${systemd_user_unitdir}"