blob: b68d40e1be61c8b76c1b7bc868276830dcdb4040 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Simple Xserver Init Script (no dm)"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4SECTION = "x11"
5PR = "r31"
6
7SRC_URI = "file://xserver-nodm \
8 file://Xusername \
9 file://gplv2-license.patch \
10 file://xserver-nodm.service \
11 file://xserver-nodm.conf \
12"
13
14S = "${WORKDIR}"
15
16# Since we refer to ROOTLESS_X which is normally enabled per-machine
17PACKAGE_ARCH = "${MACHINE_ARCH}"
18
19inherit update-rc.d systemd
20
21do_install() {
22 install -d ${D}${sysconfdir}/init.d
23 install xserver-nodm ${D}${sysconfdir}/init.d
24
25 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
26 install -d ${D}${sysconfdir}/default
27 install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
28 install -d ${D}${systemd_unitdir}/system
29 install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
30 if [ "${ROOTLESS_X}" = "1" ] ; then
31 sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm
32 sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service
33 else
34 sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm
35 sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service
36 fi
37 fi
38
39 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
40 if [ "${ROOTLESS_X}" = "1" ] ; then
41 install -d ${D}${sysconfdir}/X11
42 install Xusername ${D}${sysconfdir}/X11
43 fi
44 fi
45}
46
47RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
48
49INITSCRIPT_NAME = "xserver-nodm"
50INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
51SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
52