Patchwork [4/9] weston-init: added systemd build logic

login
register
mail settings
Submitter Valentin Popa
Date July 15, 2014, 8 a.m.
Message ID <1405411250-10594-4-git-send-email-valentin.popa@intel.com>
Download mbox | patch
Permalink /patch/75515/
State New
Headers show

Comments

Valentin Popa - July 15, 2014, 8 a.m.
Handle the case when systemd is in DISTRO_FEATURES.

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
---
 meta/recipes-graphics/wayland/weston-init.bb | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

Patch

diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 38b78bc..60cdb8d 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -7,13 +7,24 @@  SRC_URI = "file://init"
 S = "${WORKDIR}"
 
 do_install() {
-	install -d ${D}/${sysconfdir}/init.d
-	install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+       if ${@base_contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
+               install -d ${D}/${sysconfdir}/init.d
+               install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+       fi
+
+       if ${@base_contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then
+       fi
 }
 
 inherit allarch update-rc.d
 
-RDEPENDS_${PN} = "weston kbd"
+RDEPENDS_${PN} = "weston \
+                  ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'kbd', '', d)} \
+                  ${@base_contains('DISTRO_FEATURES', 'systemd', 'user-session-units', '', d)} \
+                  "
+
+DEPENDS += "weston \
+            ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
 
-INITSCRIPT_NAME = "weston"
-INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+INITSCRIPT_NAME = "${@base_contains('DISTRO_FEATURES', 'sysvinit', 'weston', '', d)}"
+INITSCRIPT_PARAMS = "${@base_contains('DISTRO_FEATURES', 'sysvinit', 'start 9 5 2 . stop 20 0 1 6 .', '', d)}"