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

DEPENDS = "systemd"

SRC_URI += " \
    file://vrpmdv-web.local \
"

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

EXTRA_OECONF = "\
    --without-http_rewrite_module \
"


do_install:append () {
    install -d ${D}${sysconfdir}/nginx/sites-available
    
    install -D -m 644 ${WORKDIR}/vrpmdv-web.local ${D}${sysconfdir}/nginx/sites-available/

    # rm -rf ${D}${systemd_unitdir}/system/nginx/sites-enabled/default_server
    rm -rf ${D}${sysconfdir}/nginx/sites-enabled/default_server
    ln -s ${sysconfdir}/nginx/sites-available/vrpmdv-web.local ${D}${sysconfdir}/nginx/sites-enabled/
}
