Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | SUMMARY = "Simple Xserver Init Script (no dm)" |
| 2 | LICENSE = "GPLv2" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | SECTION = "x11" |
| 5 | PR = "r31" |
| 6 | |
| 7 | SRC_URI = "file://xserver-nodm \ |
| 8 | file://Xusername \ |
| 9 | file://gplv2-license.patch \ |
| 10 | file://xserver-nodm.service \ |
| 11 | file://xserver-nodm.conf \ |
| 12 | " |
| 13 | |
| 14 | S = "${WORKDIR}" |
| 15 | |
| 16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine |
| 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 18 | |
| 19 | inherit update-rc.d systemd |
| 20 | |
| 21 | do_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 | |
| 47 | RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" |
| 48 | |
| 49 | INITSCRIPT_NAME = "xserver-nodm" |
| 50 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." |
| 51 | SYSTEMD_SERVICE_${PN} = "xserver-nodm.service" |
| 52 | |