vnStat is a network traffic monitor that keeps a log of daily network traffic

for the selected interface(s). vnStat isn't a packet sniffer. vnStat can be
used even without root permissions.

vnStat is focused on being small, simple and stable.
This commit is contained in:
sborrill 2009-11-19 15:48:19 +00:00
parent bcf9cfc79a
commit 505958b6b1
7 changed files with 129 additions and 0 deletions

5
net/vnstat/DESCR Normal file
View file

@ -0,0 +1,5 @@
vnStat is a network traffic monitor that keeps a log of daily network traffic
for the selected interface(s). vnStat isn't a packet sniffer. vnStat can be
used even without root permissions.
vnStat is focused on being small, simple and stable.

7
net/vnstat/MESSAGE Normal file
View file

@ -0,0 +1,7 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
You must configure the network interfaces you wish to monitor in
${PKG_SYSCONFDIR}/vnstat.conf before attempting to use this package.
===========================================================================

64
net/vnstat/Makefile Normal file
View file

@ -0,0 +1,64 @@
# $NetBSD: Makefile,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
DISTNAME= vnstat-1.9
CATEGORIES= net
MASTER_SITES= http://humdi.net/vnstat/
#DISTFILES=${DISTNAME}.tar.gz
MAINTAINER= sborrill@NetBSD.org
HOMEPAGE= http://humdi.net/vnstat/
COMMENT= Small network traffic monitor
LICENSE= gnu-gpl-v2
PKG_DESTDIR_SUPPORT= user-destdir
USE_TOOLS+= gmake
VNSTAT_CONFIG= ${PKG_SYSCONFDIR}/vnstat.conf
VNSTAT_EGDIR= ${PREFIX}/share/examples
SUBST_CLASSES+= fix-dbpath
SUBST_STAGE.fix-dbpath= pre-configure
SUBST_MESSAGE.fix-dbpath= Fixing path to database files
SUBST_FILES.fix-dbpath= src/common.h cfg/vnstat.conf
SUBST_FILES.fix-dbpath+= man/vnstat.1 man/vnstatd.1
SUBST_FILES.fix-dbpath+= man/vnstati.1
SUBST_SED.fix-dbpath= -e 's,/var/lib/,${VARBASE}/db/,g'
SUBST_CLASSES+= fix-etcpath
SUBST_STAGE.fix-etcpath= pre-configure
SUBST_MESSAGE.fix-etcpath= Fixing path to configuration files
SUBST_FILES.fix-etcpath= src/cfg.c
SUBST_FILES.fix-etcpath+= man/vnstat.1 man/vnstatd.1
SUBST_FILES.fix-etcpath+= man/vnstati.1
SUBST_SED.fix-etcpath= -e 's,/etc/,${PKG_SYSCONFDIR}/,g'
CONF_FILES= ${VNSTAT_EGDIR}/vnstat.conf ${VNSTAT_CONFIG}
RCD_SCRIPTS= vnstatd
BUILD_DEFS+= VARBASE
.include "options.mk"
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/vnstat \
${DESTDIR}${PREFIX}/bin/vnstat
${INSTALL_PROGRAM} ${WRKSRC}/src/vnstatd \
${DESTDIR}${PREFIX}/bin/vnstatd
${INSTALL_DATA} ${WRKSRC}/cfg/vnstat.conf \
${DESTDIR}${VNSTAT_EGDIR}/vnstat.conf
${INSTALL_MAN} ${WRKSRC}/man/vnstat.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR:Q}/man1/vnstat.1
${INSTALL_MAN} ${WRKSRC}/man/vnstatd.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR:Q}/man1/vnstatd.1
${INSTALL_MAN} ${WRKSRC}/man/vnstat.conf.5 \
${DESTDIR}${PREFIX}/${PKGMANDIR:Q}/man5/vnstat.conf.5
if [ "${PLIST.gd}" = "yes" ]; then \
${INSTALL_PROGRAM} ${WRKSRC}/src/vnstati \
${DESTDIR}${PREFIX}/bin/vnstati; \
${INSTALL_MAN} ${WRKSRC}/man/vnstati.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR:Q}/man1/vnstati.1; \
fi
.include "../../mk/bsd.pkg.mk"

9
net/vnstat/PLIST Normal file
View file

@ -0,0 +1,9 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
bin/vnstat
bin/vnstatd
${PLIST.gd}bin/vnstati
man/man1/vnstat.1
man/man1/vnstatd.1
${PLIST.gd}man/man1/vnstati.1
share/examples/vnstat.conf
share/examples/rc.d/vnstatd

5
net/vnstat/distinfo Normal file
View file

@ -0,0 +1,5 @@
$NetBSD: distinfo,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
SHA1 (vnstat-1.9.tar.gz) = e415369053775855dd4f88a0b20b2a56cf3df290
RMD160 (vnstat-1.9.tar.gz) = 5f9166b0c83b270ee9900dea171d54b693a29b61
Size (vnstat-1.9.tar.gz) = 76166 bytes

20
net/vnstat/files/vnstatd.sh Executable file
View file

@ -0,0 +1,20 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: vnstatd.sh,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
#
# PROVIDE: vnstatd
# REQUIRE: network mountcritlocal
$_rc_subr_loaded . /etc/rc.subr
name="vnstatd"
rcvar=$name
command="@PREFIX@/bin/${name}"
pidfile="/var/run/${name}.pid"
command_args="-d -p $pidfile"
required_dirs="@VARBASE@/db/vnstat"
required_files="@PKG_SYSCONFDIR@/vnstat.conf"
load_rc_config $name
run_rc_command "$1"

19
net/vnstat/options.mk Normal file
View file

@ -0,0 +1,19 @@
# $NetBSD: options.mk,v 1.1.1.1 2009/11/19 15:48:19 sborrill Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.vnstat
PKG_SUPPORTED_OPTIONS= gd
PKG_SUGGESTED_OPTIONS= gd
.include "../../mk/bsd.options.mk"
PLIST_VARS= gd
###
### Add support for image output
###
.if !empty(PKG_OPTIONS:Mgd)
BUILD_TARGET= all
PLIST.gd= yes
.include "../../graphics/gd/buildlink3.mk"
.else
BUILD_TARGET=
.endif