diff --git a/net/bwm-ng/Makefile b/net/bwm-ng/Makefile new file mode 100644 index 00000000000..daabef05245 --- /dev/null +++ b/net/bwm-ng/Makefile @@ -0,0 +1,23 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2005/06/21 21:52:46 niallo Exp $ + +COMMENT= "realtime bandwidth monitoring of interfaces" + +DISTNAME= bwm-ng-0.5 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=bwmng/} +HOMEPAGE= http://www.gropp.org/ + +MAINTAINER= Genadijus Paleckis + +# GPL +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +WANTLIB= c curses + +CONFIGURE_STYLE= gnu +CONFIGURE_ARGS+= --without-libstatgrab + +.include diff --git a/net/bwm-ng/distinfo b/net/bwm-ng/distinfo new file mode 100644 index 00000000000..a32ca94da72 --- /dev/null +++ b/net/bwm-ng/distinfo @@ -0,0 +1,4 @@ +MD5 (bwm-ng-0.5.tar.gz) = 4c5197527c985dc8b45973dfd00deca0 +RMD160 (bwm-ng-0.5.tar.gz) = 5fcb6d49fbd83a10bba5792c9e3d4966c8d2b0ff +SHA1 (bwm-ng-0.5.tar.gz) = 32f2a8424a1941fe2a7857a17b7cc071f6da8f40 +SIZE (bwm-ng-0.5.tar.gz) = 68498 diff --git a/net/bwm-ng/patches/patch-Makefile_in b/net/bwm-ng/patches/patch-Makefile_in new file mode 100644 index 00000000000..db767ca855e --- /dev/null +++ b/net/bwm-ng/patches/patch-Makefile_in @@ -0,0 +1,27 @@ +$OpenBSD: patch-Makefile_in,v 1.1.1.1 2005/06/21 21:52:46 niallo Exp $ +--- /tmp/Makefile.in Tue Jun 21 14:33:35 2005 ++++ Makefile.in Tue Jun 21 14:33:51 2005 +@@ -8,19 +8,17 @@ + mandir = @mandir@ + BINARY = bwm-ng + TARGET = src/$(BINARY) +-STRIP = @STRIP@ + + all: bwm-ng + + bwm-ng: + @( cd src ; $(MAKE) bwm-ng ) +- ${STRIP} + + install: all +- @(if [ ! -d $(bindir) ]; then mkdir -p $(bindir); fi ) +- cp -p ${TARGET} $(bindir)/$(BINARY) +- @(if [ ! -d $(mandir)/man1 ]; then mkdir -p $(mandir)/man1; fi) +- cp -p bwm-ng.1 $(mandir)/man1/bwm-ng.1 ++ install -o root -g wheel -m 555 src/bwm-ng ${DESTDIR}/${bindir} ++ install -o root -g wheel -m 444 bwm-ng.1 ${DESTDIR}/$(mandir)/man1 ++ install -o root -g wheel -m 755 -d ${DESTDIR}/${LOCALBASE}/share/examples/bwm-ng ++ install -o root -g wheel -m 444 bwm-ng.conf-example ${DESTDIR}/${LOCALBASE}/share/examples/bwm-ng + + clean: + @( cd src ; $(MAKE) clean ) diff --git a/net/bwm-ng/patches/patch-src_output_c b/net/bwm-ng/patches/patch-src_output_c new file mode 100644 index 00000000000..a287ce90749 --- /dev/null +++ b/net/bwm-ng/patches/patch-src_output_c @@ -0,0 +1,15 @@ +$OpenBSD: patch-src_output_c,v 1.1.1.1 2005/06/21 21:52:46 niallo Exp $ +--- src/output.c.orig Mon Jun 20 19:16:52 2005 ++++ src/output.c Mon Jun 20 19:17:00 2005 +@@ -209,9 +209,9 @@ char *values2str(char mode,t_iface_speed + || output_type==MAX_OUT || output_type==AVG_OUT + #endif + ) +- strcpy(speed,"/s"); ++ strlcpy(speed,"/s",2); + else +- strcpy(speed," "); ++ strlcpy(speed," ",2); + if ( + #if !NETSTAT_BSD_BYTES && !NETSTAT_NETBSD && NETSTAT + input_method==NETSTAT_IN || diff --git a/net/bwm-ng/patches/patch-src_retrieve_c b/net/bwm-ng/patches/patch-src_retrieve_c new file mode 100644 index 00000000000..8ce7effe44b --- /dev/null +++ b/net/bwm-ng/patches/patch-src_retrieve_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-src_retrieve_c,v 1.1.1.1 2005/06/21 21:52:46 niallo Exp $ +--- src/retrieve.c.orig Mon Jun 20 19:12:06 2005 ++++ src/retrieve.c Mon Jun 20 19:13:47 2005 +@@ -306,7 +306,7 @@ void get_iface_stats_netstat (char verbo + #if NETSTAT_BSD || NETSTAT_BSD_BYTES || NETSTAT_SOLARIS || NETSTAT_NETBSD + /* check if we have a new iface or if its only a second line of the same one */ + if (!strcmp(last_name,name)) continue; /* skip this line */ +- strcpy(last_name,name); ++ strlcpy(last_name,name,MAX_LINE_BUFFER - 1); + #endif + /* init new interfaces and add fetched data to old or new one */ + hidden_if = process_if_data (hidden_if, tmp_if_stats, &stats, name, current_if_num, verbose, diff --git a/net/bwm-ng/pkg/DESCR b/net/bwm-ng/pkg/DESCR new file mode 100644 index 00000000000..6901935904b --- /dev/null +++ b/net/bwm-ng/pkg/DESCR @@ -0,0 +1,14 @@ +Bandwidth Monitor NG is a small and simple console-based live +bandwidth monitor for Linux, BSD, Solaris, Mac OS X and others. + +Short list of features: + +* supports /proc/net/dev, netstat, getifaddr, sysctl, kstat and + libstatgrab +* unlimited number of interfaces supported +* interfaces are added or removed dynamically from list +* white-/blacklist of interfaces +* output of KB/s, Kb/s, packets, errors, average, max + and total sum +* output in curses, plain console, CSV or HTML +* configfile diff --git a/net/bwm-ng/pkg/PLIST b/net/bwm-ng/pkg/PLIST new file mode 100644 index 00000000000..1c13fa70c54 --- /dev/null +++ b/net/bwm-ng/pkg/PLIST @@ -0,0 +1,5 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2005/06/21 21:52:46 niallo Exp $ +bin/bwm-ng +@man man/man1/bwm-ng.1 +share/examples/bwm-ng/ +share/examples/bwm-ng/bwm-ng.conf-example