SUMMARY = "Install and start a systemd services"
SECTION = "mlgunicorn"
LICENSE = "CLOSED"

inherit systemd


FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI += "file://vrpmdv_setup_page.service"
SRC_URI += "file://vrpmdv_setup_page.socket"

SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "vrpmdv_setup_page.service vrpmdv_setup_page.socket "




FILES:${PN} += "${systemd_system_unitdir}"
FILES:${PN} += "${systemd_system_unitdir}/vrpmdv_setup_page.service"
FILES:${PN} += "${systemd_system_unitdir}/vrpmdv_setup_page.socket"

do_install:append () {
    install -d ${D}/${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/vrpmdv_setup_page.service ${D}/${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/vrpmdv_setup_page.socket ${D}/${systemd_system_unitdir}
    
    install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants/
    install -d ${D}${sysconfdir}/systemd/system/sockets.target.wants/     
    
    ln -s ${systemd_system_unitdir}/datalogger_setup_page.socket ${D}${sysconfdir}/systemd/system/sockets.target.wants/vrpmdv_setup_page.socket    
    ln -s ${systemd_system_unitdir}/datalogger_setup_page.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/vrpmdv_setup_page.service    
}

REQUIRED_DISTRO_FEATURES= "systemd"
