diff --git a/net/vnstat/DESCR b/net/vnstat/DESCR new file mode 100644 index 000000000000..ed24b22d6374 --- /dev/null +++ b/net/vnstat/DESCR @@ -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. diff --git a/net/vnstat/MESSAGE b/net/vnstat/MESSAGE new file mode 100644 index 000000000000..6213b14b0049 --- /dev/null +++ b/net/vnstat/MESSAGE @@ -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. + +=========================================================================== diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile new file mode 100644 index 000000000000..b0e3c76c8454 --- /dev/null +++ b/net/vnstat/Makefile @@ -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" diff --git a/net/vnstat/PLIST b/net/vnstat/PLIST new file mode 100644 index 000000000000..f4ee3fbeb2dd --- /dev/null +++ b/net/vnstat/PLIST @@ -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 diff --git a/net/vnstat/distinfo b/net/vnstat/distinfo new file mode 100644 index 000000000000..6cea7da46424 --- /dev/null +++ b/net/vnstat/distinfo @@ -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 diff --git a/net/vnstat/files/vnstatd.sh b/net/vnstat/files/vnstatd.sh new file mode 100755 index 000000000000..9a60c49ee400 --- /dev/null +++ b/net/vnstat/files/vnstatd.sh @@ -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" diff --git a/net/vnstat/options.mk b/net/vnstat/options.mk new file mode 100644 index 000000000000..ff01ef35a92e --- /dev/null +++ b/net/vnstat/options.mk @@ -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