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/eg25-manager.git;protocol=https;branch=master \
            file://eg25d"

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

DEPENDS:append = " libgudev libgpiod libusb curl "

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/init.d
    install -m 0755 ${UNPACKDIR}/eg25d ${D}/etc/init.d/
    install -d ${D}/etc/udev/
    install -d ${D}/etc/udev/rules.d
    mv ${D}/usr/lib/udev/rules.d/80-modem-eg25.rules ${D}/etc/udev/rules.d/
    rm ${D}/usr/lib/systemd/system/eg25-manager.service
    rm -rf ${D}/usr/lib/systemd

    install -d ${D}/etc/eg25-manager/
    mv ${D}/usr/share/eg25-manager/* ${D}/etc/eg25-manager/
    rm -rf ${D}/usr/share
    rm -rf ${D}/usr/lib
}

FILES:${PN} = " /etc/init.d/eg25d \
                /etc/eg25-manager \
                /etc/udev/rules.d/80-modem-eg25.rules \
                /usr/bin/eg25-manager "