svn commit: r520189 - in head/net-mgmt/arpwatch: . files

Craig Leres leres at FreeBSD.org
Sun Dec 15 18:49:29 UTC 2019


Author: leres
Date: Sun Dec 15 18:49:27 2019
New Revision: 520189
URL: https://svnweb.freebsd.org/changeset/ports/520189

Log:
  net-mgmt/arpwatch: Update to 3.0. Update MASTER_SITES. Add options
  for DEBUG (build with debugging support), ETHERCODES (install
  ethercodes.dat optionally), and ZEROPAD (zero pad displayed ethernet
  addresses by default).
  
  Take maintainership as per pi@ in the PR.
  
  Notable changes since 2.1a15:
  
      - Add -Z (zero pad) and -C (compact) flags to arpwatch and
        arpsnmp to allow run time selection of zero padded or compact
        ethernet addresses in arp.dat.
  
      - Check for I/O errors when writing new arp.dat file.
  
      - Add a FreeBSD rc.d startup script.
  
      - Escape unprintable hostnames in arp.dat to avoid corruption.
  
      - Added the -x flag which is like -n but excludes cidrs. Code
        contributed by Roman Ivanov (awant13 at gmail.com).
  
      - Incorporated other fixes and patches with a lot of help from
        Kurt Jaeger (pi at FreeBSD.org).
  
      - Speed up arp.dat parsing by increasing the size of the hash
        table.
  
      - Control watcher/watchee from the command line (-w/W flags).
  
  PR:		242346
  Approved by:	pi (maintainer), ler (mentor, implicit)

Deleted:
  head/net-mgmt/arpwatch/files/patch-Makefile.in
  head/net-mgmt/arpwatch/files/patch-arpsnmp.8
  head/net-mgmt/arpwatch/files/patch-arpwatch.8
  head/net-mgmt/arpwatch/files/patch-configure
  head/net-mgmt/arpwatch/files/patch-db.c
  head/net-mgmt/arpwatch/files/patch-dns.c
  head/net-mgmt/arpwatch/files/patch-report.c
  head/net-mgmt/arpwatch/files/patch-util.c
  head/net-mgmt/arpwatch/files/patch-util.h
Modified:
  head/net-mgmt/arpwatch/Makefile
  head/net-mgmt/arpwatch/distinfo
  head/net-mgmt/arpwatch/files/patch-arpsnmp.c
  head/net-mgmt/arpwatch/files/patch-arpwatch.c
  head/net-mgmt/arpwatch/files/pkg-message.in
  head/net-mgmt/arpwatch/pkg-descr
  head/net-mgmt/arpwatch/pkg-plist

Modified: head/net-mgmt/arpwatch/Makefile
==============================================================================
--- head/net-mgmt/arpwatch/Makefile	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/Makefile	Sun Dec 15 18:49:27 2019	(r520189)
@@ -2,34 +2,60 @@
 # $FreeBSD$
 
 PORTNAME=	arpwatch
-DISTVERSION=	2.1a15
-PORTREVISION=	10
+PORTVERSION=	3.0
 CATEGORIES=	net-mgmt
-MASTER_SITES=	ftp://ftp.ee.lbl.gov/ \
-		GENTOO
+MASTER_SITES=	https://ee.lbl.gov/downloads/arpwatch/ \
+		LOCAL/leres/arpwatch
 
-MAINTAINER=	pi at FreeBSD.org
+MAINTAINER=	leres at FreeBSD.org
 COMMENT=	Monitor arp & rarp requests
 
 LICENSE=	BSD3CLAUSE
 
+BUILD_DEPENDS=	${LOCALBASE}/include/pcap.h:net/libpcap
+RUN_DEPENDS=	${LOCALBASE}/include/pcap.h:net/libpcap
+
+USES=		python:run
+
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--quiet
-INSTALL_TARGET=	install install-man
 
-SUB_FILES=	pkg-message
-USE_RC_SUBR=	arpwatch
+SUB_FILES=      pkg-message
 
+OPTIONS_DEFINE=	DEBUG ETHERCODES ZEROPAD
+OPTIONS_DEFAULT=ETHERCODES ZEROPAD
+OPTIONS_SUB=	yes
+
+ETHERCODES_DESC=install ethercodes.dat
+ZEROPAD_DESC=	zero pad displayed ethernet addresses by default
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDEBUG}
+CONFIGURE_ARGS+=        --disable-optimization
+.endif
+
+.if ${PORT_OPTIONS:MZEROPAD}
+CONFIGURE_ARGS+=        --enable-zeropad
+.endif
+
 .ifdef ARPDIR
 MAKE_ARGS=	ARPDIR=${ARPDIR}
 .endif
 
 post-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/arpwatch
-	for files in ethercodes.dat d.awk duplicates.awk euppertolower.awk e.awk p.awk; do \
-		${INSTALL_DATA} ${WRKSRC}/$$files ${STAGEDIR}${PREFIX}/arpwatch;	\
-	done
+.for F in ethercodes.dat d.awk duplicates.awk euppertolower.awk e.awk p.awk
+	${INSTALL_DATA} ${WRKSRC}/${F} ${STAGEDIR}${PREFIX}/arpwatch
+.endfor
 	${INSTALL_SCRIPT} ${WRKSRC}/arp2ethers ${STAGEDIR}${PREFIX}/arpwatch
-	${INSTALL_SCRIPT} ${WRKSRC}/massagevendor ${STAGEDIR}${PREFIX}/arpwatch
+	${INSTALL_SCRIPT} ${WRKSRC}/massagevendor.py \
+	    ${STAGEDIR}${PREFIX}/arpwatch/massagevendor
+.if ${PORT_OPTIONS:METHERCODES}
+	${INSTALL_DATA} ${WRKSRC}/ethercodes.dat ${STAGEDIR}${PREFIX}/arpwatch
+.endif
+
+post-configure:
+	${REINPLACE_CMD} -e "/^LIBS *=/s,-lpcap,${LOCALBASE}/lib/libpcap.so.1," \
+		${WRKSRC}/Makefile
 
 .include <bsd.port.mk>

Modified: head/net-mgmt/arpwatch/distinfo
==============================================================================
--- head/net-mgmt/arpwatch/distinfo	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/distinfo	Sun Dec 15 18:49:27 2019	(r520189)
@@ -1,2 +1,3 @@
-SHA256 (arpwatch-2.1a15.tar.gz) = c1df9737e208a96a61fa92ddad83f4b4d9be66f8992f3c917e9edf4b05ff5898
-SIZE (arpwatch-2.1a15.tar.gz) = 202729
+TIMESTAMP = 1575239752
+SHA256 (arpwatch-3.0.tar.gz) = 82e137e104aca8b1280f5cca0ebe61b978f10eadcbb4c4802c181522ad02b25b
+SIZE (arpwatch-3.0.tar.gz) = 407879

Modified: head/net-mgmt/arpwatch/files/patch-arpsnmp.c
==============================================================================
--- head/net-mgmt/arpwatch/files/patch-arpsnmp.c	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/files/patch-arpsnmp.c	Sun Dec 15 18:49:27 2019	(r520189)
@@ -1,39 +1,22 @@
---- arpsnmp.c.orig	2004-01-22 22:25:17 UTC
+--- arpsnmp.c.orig	2019-11-30 18:35:23 UTC
 +++ arpsnmp.c
-@@ -68,6 +68,8 @@ __dead	void usage(void) __attribute__((v
- 
- char *prog;
- 
-+char *Watcher;
-+
- extern int optind;
- extern int opterr;
- extern char *optarg;
-@@ -90,7 +92,7 @@ main(int argc, char **argv)
+@@ -104,7 +104,7 @@ main(int argc, char **argv)
  	}
  
  	opterr = 0;
--	while ((op = getopt(argc, argv, "df:")) != EOF)
-+	while ((op = getopt(argc, argv, "df:m:")) != EOF)
+-	while ((op = getopt(argc, argv, "CdD:f:qsw:W:Z")) != EOF)
++	while ((op = getopt(argc, argv, "CdD:f:m:qsw:W:Z")) != EOF)
  		switch (op) {
  
- 		case 'd':
-@@ -105,6 +107,10 @@ main(int argc, char **argv)
- 			arpfile = optarg;
+ 		case 'C':
+@@ -135,6 +135,10 @@ main(int argc, char **argv)
+ 			++suppress;
  			break;
  
 +		case 'm':
-+			Watcher = optarg;
-+			break;
-+
- 		default:
- 			usage();
- 		}
-@@ -185,6 +191,6 @@ usage(void)
- 
- 	(void)fprintf(stderr, "Version %s\n", version);
- 	(void)fprintf(stderr,
--	    "usage: %s [-d] [-f datafile] file [...]\n", prog);
-+	    "usage: %s [-d] [-f datafile] [-m email] file [...]\n", prog);
- 	exit(1);
- }
++			fprintf(stderr, "%s: WARNING: -m is deprecated,"
++			    " please use -w instead\n", prog);
++			/* fallthrough */
+ 		case 'w':
+ 			watcher = optarg;
+ 			break;

Modified: head/net-mgmt/arpwatch/files/patch-arpwatch.c
==============================================================================
--- head/net-mgmt/arpwatch/files/patch-arpwatch.c	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/files/patch-arpwatch.c	Sun Dec 15 18:49:27 2019	(r520189)
@@ -1,66 +1,22 @@
---- arpwatch.c.orig	2004-01-22 22:18:20 UTC
+--- arpwatch.c.orig	2019-11-30 18:35:23 UTC
 +++ arpwatch.c
-@@ -107,6 +107,8 @@ struct rtentry;
- 
- char *prog;
- 
-+char *Watcher = NULL;
-+
- int can_checkpoint;
- int swapped;
- int nobogons;
-@@ -170,7 +172,7 @@ main(int argc, char **argv)
+@@ -198,7 +198,7 @@ main(int argc, char **argv)
  	interface = NULL;
  	rfilename = NULL;
  	pd = NULL;
--	while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
-+	while ((op = getopt(argc, argv, "dvzf:i:m:n:Nr:")) != EOF)
+-	while ((op = getopt(argc, argv, "CdD:Ff:i:n:NpP:qr:svw:W:x:zZ")) != EOF)
++	while ((op = getopt(argc, argv, "CdD:Ff:i:m:n:NpP:qr:svw:W:x:zZ")) != EOF)
  		switch (op) {
  
- 		case 'd':
-@@ -202,6 +204,16 @@ main(int argc, char **argv)
- 			rfilename = optarg;
+ 		case 'C':
+@@ -262,6 +262,10 @@ main(int argc, char **argv)
+ 			++vrrpflag;
  			break;
  
 +		case 'm':
-+			Watcher = optarg;
-+			break;
-+		case 'v':
-+			vrrpflag = 1;
-+			break;
-+		case 'z':
-+			zeroflag = 1;
-+			break;
-+
- 		default:
- 			usage();
- 		}
-@@ -321,7 +333,6 @@ main(int argc, char **argv)
- 
- 	(void)setsignal(SIGINT, die);
- 	(void)setsignal(SIGTERM, die);
--	(void)setsignal(SIGHUP, die);
- 	if (rfilename == NULL) {
- 		(void)setsignal(SIGQUIT, checkpoint);
- 		(void)setsignal(SIGALRM, checkpoint);
-@@ -391,6 +402,12 @@ process_ether(register u_char *u, regist
- 		return;
- 	}
- 
-+	/* Check for CARP-generated ARP replies and ignore them */
-+	if (vrrpflag == 1 && MEMCMP(sha, vrrp_prefix, 5) == 0) {
-+		/* do nothing */
-+		return;
-+	}
-+
- 	/* Double check ethernet addresses */
- 	if (MEMCMP(sea, sha, 6) != 0) {
- 		dosyslog(LOG_INFO, "ethernet mismatch", sia, sea, sha);
-@@ -751,6 +768,6 @@ usage(void)
- 
- 	(void)fprintf(stderr, "Version %s\n", version);
- 	(void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"
--	    " [-n net[/width]] [-r file]\n", prog);
-+	    " [-m email] [-n net[/width]] [-r file]\n", prog);
- 	exit(1);
- }
++			fprintf(stderr, "%s: WARNING: -m is deprecated,"
++			    " please use -w instead\n", prog);
++			/* fallthrough */
+ 		case 'w':
+ 			watcher = optarg;
+ 			break;

Modified: head/net-mgmt/arpwatch/files/pkg-message.in
==============================================================================
--- head/net-mgmt/arpwatch/files/pkg-message.in	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/files/pkg-message.in	Sun Dec 15 18:49:27 2019	(r520189)
@@ -1,12 +1,18 @@
 [
 { type: install
   message: <<EOM
-You can update the ethercodes.dat file executing the following steps
+You can update the ethercodes.dat file executing the following steps:
 
-cd %%PREFIX%%/arpwatch
-fetch -o- http://standards-oui.ieee.org//oui.txt | tr -d "\15" > oui.txt
-./massagevendor oui.txt > ethercodes.dat
-rm oui.txt
+    cd %%PREFIX%%/arpwatch
+    fetch http://standards-oui.ieee.org/oui/oui.csv
+    ./massagevendor oui.csv > ethercodes.dat
+    rm oui.csv
+
+You might also want to disable the ETHERCODES option when building
+to avoid clobbering ethercodes.dat on update or reinstall.
+
+The -m flag is deprecated. If you are using the -m watcher flag,
+please switch to -w.
 EOM
 }
 ]

Modified: head/net-mgmt/arpwatch/pkg-descr
==============================================================================
--- head/net-mgmt/arpwatch/pkg-descr	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/pkg-descr	Sun Dec 15 18:49:27 2019	(r520189)
@@ -2,4 +2,4 @@ This package contains tools that monitors ethernet act
 maintains a database of ethernet/ip address pairings. It also reports
 certain changes via email.
 
-WWW: http://ee.lbl.gov/
+WWW: https://ee.lbl.gov/downloads/arpwatch/

Modified: head/net-mgmt/arpwatch/pkg-plist
==============================================================================
--- head/net-mgmt/arpwatch/pkg-plist	Sun Dec 15 17:34:12 2019	(r520188)
+++ head/net-mgmt/arpwatch/pkg-plist	Sun Dec 15 18:49:27 2019	(r520189)
@@ -6,6 +6,7 @@ arpwatch/ethercodes.dat
 arpwatch/euppertolower.awk
 arpwatch/massagevendor
 arpwatch/p.awk
+etc/rc.d/arpwatch
 man/man8/arpsnmp.8.gz
 man/man8/arpwatch.8.gz
 sbin/arpsnmp


More information about the svn-ports-head mailing list