DESCRIPTION = "Diya session manager"
DEPENDS = "glib-2.0"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI += "git://git.iohub.dev/dany/diya-session-manager.git;protocol=https;branch=master \
            file://daemon.conf \
            file://dbus-diya.conf \
            file://diya-session-launch \
            file://diya-sessiond"

SRCREV = "${AUTOREV}"
PV = "0.1.1+git${SRCPV}"
S = "${UNPACKDIR}/git"

inherit meson pkgconfig

# inherit update-rc.d
# INITSCRIPT_NAME = "diya-sessiond"
# INITSCRIPT_PARAMS = "start 30 5 . stop 10 0 1 6 ."


do_install:append() {
    install -d ${D}/etc/diya
    install -d ${D}/usr/bin
    install -d ${D}/etc/dbus-1
    install -d ${D}/etc/dbus-1/system.d
    install -d ${D}/etc/init.d
    install -m 0755 ${WORKDIR}/build/diya-session-manager ${D}/usr/bin/
    install -m 0755 ${UNPACKDIR}/diya-sessiond ${D}/etc/init.d/
    install -m 0755 ${UNPACKDIR}/diya-session-launch ${D}/usr/bin/
    install -m 0644 ${UNPACKDIR}/daemon.conf ${D}/etc/diya/
    install -m 0644 ${UNPACKDIR}/dbus-diya.conf ${D}/etc/dbus-1/system.d/
}

FILES:${PN} = "/etc/diya \
                /etc/dbus-1/system.d/dbus-diya.conf \
                /usr/bin/diya-session-manager \
                /usr/bin/diya-session-launch \
                /etc/init.d/diya-sessiond"