meta-netmodule-distro/backports/networking-layer/recipes-support/vnstat/vnstat_2.6.bb

33 lines
1.3 KiB
BlitzBasic

DESCRIPTION = "vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s)."
HOMEPAGE = "https://humdi.net/vnstat/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SECTION = "net"
DEPENDS = "gd sqlite3"
SRC_URI = "https://github.com/vergoh/vnstat/releases/download/v${PV}/${BPN}-${PV}.tar.gz"
SRC_URI[md5sum] = "fe2928a81243cc8a532a357f97221736"
SRC_URI[sha256sum] = "89276e0a7281943edb554b874078278ad947dc312938a2451e03eb80679f7ff7"
inherit autotools pkgconfig systemd
EXTRA_OECONF = "--disable-extra-paths"
do_configure:append() {
# enable a volatile and persistent path for reading and writing the data base:
sed -i 's|ReadWritePaths=\/var\/lib|ReadWritePaths=\/var\/lib \/run\/|g' ${S}/examples/systemd/vnstat.service
# adapt the default config running in volatile mode
sed -i 's|DatabaseDir \"\/var\/lib\/vnstat\"|DatabaseDir \"\/run\/vnstat\"|g' ${S}/cfg/vnstat.conf
# add wwan0 as default interface
sed -i 's|Interface \"\"|Interface \"wwan0\"|g' ${S}/cfg/vnstat.conf
}
do_install:append() {
install -Dm644 ${S}/examples/systemd/vnstat.service "${D}${systemd_system_unitdir}/vnstat.service"
}
SYSTEMD_SERVICE:${PN} = "vnstat.service"