b4abc6f0ef5a4474f17e2f368b6710ad3251c809
[scm/bb/meta-tizen.git] / meta-tizen-common-demo / recipes-graphics / weston-common / weston-common-extraconf.inc
1 FILESEXTRAPATHS_append := "${THISDIR}/weston-common"
2
3 SRC_URI += "file://0001-Yocto-correct-paths-to-ln-and-chmod.patch"
4 SRC_URI += "file://0002-Add-a-script-to-export-UID.patch"
5
6 DEPENDS += "config-tizen-common"
7 RDEPENDS_${PN} += "config-tizen-common"
8
9 inherit useradd
10
11 USERADD_PACKAGES = "${PN}"
12 GROUPADD_PARAM_${PN} += "--system  display;"
13 GROUPADD_PARAM_${PN} += "--system  input;"
14 GROUPADD_PARAM_${PN} += "--system  weston-launch"
15
16 do_install_append() {
17     install -m 755 uid.sh ${D}/etc/profile.d
18
19     mkdir -p ${D}${prefix}/lib/systemd/user/default.target.requires
20     ln -sf ../weston-user.service ${D}${prefix}/lib/systemd/user/default.target.requires/weston-user.service
21
22     mkdir -p ${D}/lib/systemd/system/graphical.target.wants
23     ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5001.service
24     ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5002.service
25     ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5003.service
26     ln -sf ../user-session-launch@.service ${D}/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-9999.service
27
28     mkdir -p ${D}${systemd_unitdir}/system/multi-user.target.wants
29     ln -sf ../systemd-udev-settle.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-udev-settle.service
30 }
31
32 pkg_preinst_${PN}() {
33     #!/bin/sh -e
34
35     # setup display manager service
36     mkdir -p $D${systemd_unitdir}/system/graphical.target.wants/
37     ln -sf ../display-manager.path  $D${systemd_unitdir}/system/graphical.target.wants/
38     # setup display manager access (inside user session)
39     mkdir -p $D${prefix}/lib/systemd/user/default.target.requires/
40     ln -sf ../weston-user.service  $D${prefix}/lib/systemd/user/default.target.requires/
41
42 }
43
44 pkg_postinst_${PN} () {
45     for user in alice bob carol guest; do
46         for appdir in desktop manifest dbspace; do
47             mkdir -p $D/home/$user/.applications/$appdir
48         done
49         find $D/home/$user/ -type d -exec chsmack -a User {} \;
50         chown -R $user:users $D/home/$user/
51     done
52     
53     SERVICE_PATH=$D/lib/systemd/system/user-session-launch@.service
54     grep -q display-manager.path $SERVICE_PATH || sed -i 's@systemd-logind.service@systemd-logind.service display-manager.path@g' $SERVICE_PATH
55 }
56
57 weston-common_files += "${prefix}/lib/systemd/user/default.target.requires/weston-user.service/*"
58 weston-common_files += "/home/*"
59
60 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5001.service"
61 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5002.service"
62 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5003.service"
63 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-9999.service"
64 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session@5001.service"
65 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session@5002.service"
66 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session@5003.service"
67 FILES_${PN} += "/lib/systemd/system/graphical.target.wants/user-session@9999.service"