pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

vnstat: Update to 2.13



Module Name:	pkgsrc-wip
Committed By:	Kimmo Suominen <kimmo%suominen.com@localhost>
Pushed By:	kim
Date:		Sun Apr 5 23:20:10 2026 +0300
Changeset:	3aeae1e6f823149d5a120a1cc3548e95102e278c

Added Files:
	vnstat/DESCR
	vnstat/Makefile
	vnstat/Makefile.common
	vnstat/PLIST
	vnstat/distinfo
	vnstat/files/vnstatd.sh
	vnstat/patches/patch-src_cfg.c
	vnstat/patches/patch-src_common.h
	vnstati/DESCR
	vnstati/Makefile
	vnstati/PLIST

Log Message:
vnstat: Update to 2.13

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3aeae1e6f823149d5a120a1cc3548e95102e278c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 vnstat/DESCR                      |  5 +++++
 vnstat/Makefile                   | 16 ++++++++++++++++
 vnstat/Makefile.common            | 36 ++++++++++++++++++++++++++++++++++++
 vnstat/PLIST                      |  7 +++++++
 vnstat/distinfo                   |  7 +++++++
 vnstat/files/vnstatd.sh           | 20 ++++++++++++++++++++
 vnstat/patches/patch-src_cfg.c    | 16 ++++++++++++++++
 vnstat/patches/patch-src_common.h | 14 ++++++++++++++
 vnstati/DESCR                     |  2 ++
 vnstati/Makefile                  | 22 ++++++++++++++++++++++
 vnstati/PLIST                     |  3 +++
 11 files changed, 148 insertions(+)

diffs:
diff --git a/vnstat/DESCR b/vnstat/DESCR
new file mode 100644
index 0000000000..ed24b22d63
--- /dev/null
+++ b/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/vnstat/Makefile b/vnstat/Makefile
new file mode 100644
index 0000000000..527f6eecb6
--- /dev/null
+++ b/vnstat/Makefile
@@ -0,0 +1,16 @@
+# $NetBSD$
+
+CONF_FILES=		${EGDIR}/vnstat.conf ${PKG_SYSCONFDIR}/vnstat.conf
+CONFIGURE_ARGS+=	--disable-image-output
+EGDIR=			${PREFIX}/share/examples/${PKGBASE}
+INSTALLATION_DIRS=	bin ${EGDIR} ${PKGMANDIR}/man1 \
+			${PKGMANDIR}/man5 ${PKGMANDIR}/man8
+RCD_SCRIPTS=		vnstatd
+
+post-install:
+	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/vnstat.conf \
+		${DESTDIR}${EGDIR}/vnstat.conf
+	${RM} -f ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/vnstati.1
+
+.include "../../wip/vnstat/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/vnstat/Makefile.common b/vnstat/Makefile.common
new file mode 100644
index 0000000000..b2989ea013
--- /dev/null
+++ b/vnstat/Makefile.common
@@ -0,0 +1,36 @@
+# $NetBSD$
+#
+# used by wip/vnstat/Makefile
+# used by wip/vnstati/Makefile
+
+DISTNAME=			vnstat-2.13
+CATEGORIES=			net
+MASTER_SITES=			http://humdi.net/vnstat/
+
+MAINTAINER=			sborrill%NetBSD.org@localhost
+HOMEPAGE=			https://humdi.net/vnstat/
+COMMENT=			Small network traffic monitor
+LICENSE=			gnu-gpl-v2
+
+GNU_CONFIGURE=			yes
+CONFIGURE_ARGS+=		--disable-extra-paths
+CONFIGURE_ARGS+=		--localstatedir='${VARBASE}'
+CONFIGURE_ARGS+=		--sysconfdir='${PKG_SYSCONFDIR}'
+
+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.8
+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.8
+SUBST_FILES.fix-etcpath+=	man/vnstati.1
+SUBST_SED.fix-etcpath=		-e 's,/etc/,${PKG_SYSCONFDIR}/,g'
+
+BUILD_DEFS+=			PKG_SYSCONFDIR VARBASE
diff --git a/vnstat/PLIST b/vnstat/PLIST
new file mode 100644
index 0000000000..9f0ba28001
--- /dev/null
+++ b/vnstat/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD$
+bin/vnstat
+man/man1/vnstat.1
+man/man5/vnstat.conf.5
+man/man8/vnstatd.8
+sbin/vnstatd
+share/examples/vnstat/vnstat.conf
diff --git a/vnstat/distinfo b/vnstat/distinfo
new file mode 100644
index 0000000000..b45ab0235c
--- /dev/null
+++ b/vnstat/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.7 2024/10/10 19:56:01 nia Exp $
+
+BLAKE2s (vnstat-2.13.tar.gz) = 5def825fa8dc8ee5b50bce73847691ea6b0028287f9881374c8330c3ccb3038e
+SHA512 (vnstat-2.13.tar.gz) = 9b5d7b5085ab2ae39fd6b0d59afe56eb927b6e4ca1ca30ee7710afe2a412c4a1a8d756e095e9c3c81d182e3d6bb2efcd9a2a266e0048cac249477a09c1368969
+Size (vnstat-2.13.tar.gz) = 336647 bytes
+SHA1 (patch-src_cfg.c) = 8cbc8247fb2431f385afda806516d360a9ce69d8
+SHA1 (patch-src_common.h) = abd8b9f44cb7b5acc3a0952a7caddaf66a01d4bf
diff --git a/vnstat/files/vnstatd.sh b/vnstat/files/vnstatd.sh
new file mode 100755
index 0000000000..48d2e25dfa
--- /dev/null
+++ b/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@/sbin/${name}"
+pidfile="/var/run/${name}/${name}.pid"
+command_args="-d"
+required_dirs="@VARBASE@/db/vnstat"
+required_files="@PKG_SYSCONFDIR@/vnstat.conf"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/vnstat/patches/patch-src_cfg.c b/vnstat/patches/patch-src_cfg.c
new file mode 100644
index 0000000000..5689883001
--- /dev/null
+++ b/vnstat/patches/patch-src_cfg.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Avoid a nonsensical config file path that would result after munging
+/etc/ to PKG_SYSCONFDIR.
+
+--- src/cfg.c.orig	2025-01-08 23:15:52.000000000 +0200
++++ src/cfg.c	2026-04-05 21:55:29.559610294 +0300
+@@ -484,8 +484,6 @@
+ 			strncpy_nt(cfg.cfgfile, buffer, 512);
+ 		} else if ((*fd = fopen("/etc/vnstat.conf", "r")) != NULL) {
+ 			snprintf(cfg.cfgfile, 512, "/etc/vnstat.conf");
+-		} else if ((*fd = fopen("/usr/local/etc/vnstat.conf", "r")) != NULL) {
+-			snprintf(cfg.cfgfile, 512, "/usr/local/etc/vnstat.conf");
+ 		} else {
+ 			if (debug)
+ 				printf("Config file: none\n");
diff --git a/vnstat/patches/patch-src_common.h b/vnstat/patches/patch-src_common.h
new file mode 100644
index 0000000000..113aba6806
--- /dev/null
+++ b/vnstat/patches/patch-src_common.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_common.h,v 1.1 2024/10/10 19:56:02 nia Exp $
+
+Include <fcntl.h> for open(2).
+
+--- src/common.h.orig	2024-10-10 19:54:21.793147584 +0000
++++ src/common.h
+@@ -5,6 +5,7 @@
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <locale.h>
+ #include <time.h>
+ #include <string.h>
diff --git a/vnstati/DESCR b/vnstati/DESCR
new file mode 100644
index 0000000000..3aac3c62c2
--- /dev/null
+++ b/vnstati/DESCR
@@ -0,0 +1,2 @@
+
+This package adds image output support for vnStat.
diff --git a/vnstati/Makefile b/vnstati/Makefile
new file mode 100644
index 0000000000..b7908c1fa1
--- /dev/null
+++ b/vnstati/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD$
+
+PKGNAME=		${DISTNAME:S/-/i-/}
+
+PATCHDIR=		../../wip/vnstat/patches
+PKGDIR=			../../wip/vnstat
+PLIST_SRC=		PLIST
+DESCR_SRC=		../../wip/vnstat/DESCR DESCR
+
+CONFLICTS+=		vnstat<2.13
+
+INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/vnstati \
+	  ${DESTDIR}${PREFIX}/bin/vnstati
+	${INSTALL_MAN} ${WRKSRC}/man/vnstati.1 \
+	  ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/vnstati.1
+
+.include "../../wip/vnstat/Makefile.common"
+.include "../../graphics/gd/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/vnstati/PLIST b/vnstati/PLIST
new file mode 100644
index 0000000000..421b600cbe
--- /dev/null
+++ b/vnstati/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+bin/vnstati
+man/man1/vnstati.1


Home | Main Index | Thread Index | Old Index