blob: a6d0d5eeea66dd98269cb56120bc2bcb6f1fdefc [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 \
Patrick Williamsc0f7c042017-02-23 20:41:17 -06008 file://Xserver \
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009 file://gplv2-license.patch \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060010 file://xserver-nodm.service.in \
11 file://xserver-nodm.conf.in \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012"
13
14S = "${WORKDIR}"
15
16# Since we refer to ROOTLESS_X which is normally enabled per-machine
17PACKAGE_ARCH = "${MACHINE_ARCH}"
18
Patrick Williamsc0f7c042017-02-23 20:41:17 -060019inherit update-rc.d systemd distro_features_check
20
21REQUIRED_DISTRO_FEATURES = "x11"
22
23PACKAGECONFIG ??= "blank"
24# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
25PACKAGECONFIG[blank] = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27do_install() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 install -d ${D}${sysconfdir}/default
29 install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
30 install -d ${D}${sysconfdir}/xserver-nodm
31 install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
32
33 BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
34 if [ "${ROOTLESS_X}" = "1" ] ; then
35 XUSER_HOME="/home/xuser"
36 XUSER="xuser"
37 else
38 XUSER_HOME=${ROOT_HOME}
39 XUSER="root"
40 fi
41 sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
42 ${D}${sysconfdir}/default/xserver-nodm
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043
44 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 install -d ${D}${systemd_unitdir}/system
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
47 sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048 fi
49
50 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051 install -d ${D}${sysconfdir}/init.d
52 install xserver-nodm ${D}${sysconfdir}/init.d
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 fi
54}
55
Patrick Williamsc0f7c042017-02-23 20:41:17 -060056RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057
58INITSCRIPT_NAME = "xserver-nodm"
59INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
60SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
61