svn commit: r368273 - in head/net-mgmt/ipv6mon: . files
Hiroki Sato
hrs at FreeBSD.org
Mon Sep 15 16:11:41 UTC 2014
Author: hrs
Date: Mon Sep 15 16:11:39 2014
New Revision: 368273
URL: http://svnweb.freebsd.org/changeset/ports/368273
QAT: https://qat.redports.org/buildarchive/r368273/
Log:
- Add $ipv6mon_interfaces support to rc.d/ipv6mon.
- Style fix.
PR: 180324
Added:
head/net-mgmt/ipv6mon/files/Makefile
- copied, changed from r368266, head/net-mgmt/ipv6mon/files/patch-Makefile
Deleted:
head/net-mgmt/ipv6mon/files/patch-Makefile
Modified:
head/net-mgmt/ipv6mon/Makefile
head/net-mgmt/ipv6mon/files/ipv6mon.in
head/net-mgmt/ipv6mon/pkg-descr
Modified: head/net-mgmt/ipv6mon/Makefile
==============================================================================
--- head/net-mgmt/ipv6mon/Makefile Mon Sep 15 15:53:58 2014 (r368272)
+++ head/net-mgmt/ipv6mon/Makefile Mon Sep 15 16:11:39 2014 (r368273)
@@ -1,9 +1,8 @@
-# Created by: Hiroki Sato <hrs at FreeBSD.org>
# $FreeBSD$
PORTNAME= ipv6mon
PORTVERSION= 1.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net-mgmt ipv6
MASTER_SITES= http://www.si6networks.com/tools/ipv6mon/
DISTNAME= ${PORTNAME}-v${PORTVERSION}
@@ -11,14 +10,8 @@ DISTNAME= ${PORTNAME}-v${PORTVERSION}
MAINTAINER= hrs at FreeBSD.org
COMMENT= Tool for monitoring IPv6 address usage
-OPTIONS_DEFINE= DOCS
-
LICENSE= GPLv3
-USES= uidfix
-#Ignore "normal" destdir from port infra
-DESTDIRNAME= IGNOREME
-MAKE_ENV= DESTDIR=${STAGEDIR}${PREFIX}/
CFLAGS+= -DIPV6MON_CONF=\\\"${PREFIX}/etc/ipv6mon.conf\\\"
USERS= ${PORTNAME}
GROUPS= ${PORTNAME}
@@ -30,7 +23,10 @@ PORTDOCS= README.TXT \
ipv6mon-manual.odt \
ipv6mon-manual.pdf
+OPTIONS_DEFINE= DOCS
+
post-extract:
+ ${INSTALL_DATA} ${FILESDIR}/Makefile ${WRKSRC}
${INSTALL_DATA} ${WRKSRC}/manuals/* ${WRKSRC}
post-install:
Copied and modified: head/net-mgmt/ipv6mon/files/Makefile (from r368266, head/net-mgmt/ipv6mon/files/patch-Makefile)
==============================================================================
--- head/net-mgmt/ipv6mon/files/patch-Makefile Mon Sep 15 14:51:35 2014 (r368266, copy source)
+++ head/net-mgmt/ipv6mon/files/Makefile Mon Sep 15 16:11:39 2014 (r368273)
@@ -1,19 +1,19 @@
---- /dev/null 2012-09-18 11:55:15.000000000 +0900
-+++ Makefile 2012-09-18 11:55:52.000000000 +0900
-@@ -0,0 +1,16 @@
-+# $FreeBSD$
-+
-+PROG= ipv6mon
-+LDADD= -lpcap
-+
-+FILES= ipv6mon.conf
-+FILESNAME= ipv6mon.conf.sample
-+FILESDIR= etc
-+
-+BINDIR= sbin
-+MANDIR= man/man
-+
-+MAN= ipv6mon.8 ipv6mon.conf.5
-+NO_MANCOMPRESS=
-+
-+.include <bsd.prog.mk>
+# $FreeBSD$
+
+PROG= ipv6mon
+LDADD= -lpcap
+
+PREFIX?= /usr/local
+
+FILES= ipv6mon.conf
+FILESNAME= ipv6mon.conf.sample
+FILESDIR= ${PREFIX}/etc
+
+BINDIR= ${PREFIX}/sbin
+MANDIR= ${PREFIX}/man/man
+
+MAN= ipv6mon.8 ipv6mon.conf.5
+NO_MANCOMPRESS=
+WITH_INSTALL_AS_USER=yes
+
+.include <bsd.prog.mk>
Modified: head/net-mgmt/ipv6mon/files/ipv6mon.in
==============================================================================
--- head/net-mgmt/ipv6mon/files/ipv6mon.in Mon Sep 15 15:53:58 2014 (r368272)
+++ head/net-mgmt/ipv6mon/files/ipv6mon.in Mon Sep 15 16:11:39 2014 (r368273)
@@ -6,13 +6,53 @@
# BEFORE: LOGIN
# KEYWORD: nojail shutdown
+# $ipv6mon_interfaces:
+# If specified, multiple instances of ipv6mon are invoked.
+# Configuration files for each interfaces are automatically
+# generated from %%PREFIX%%/etc/ipv6mon.conf.
+#
+# Example:
+# ipv6mon_interfaces="bge0 bge1"
+#
+# An interface can be specified in a command line argument. If
+# not specified, the action is applied to all of the interfaces.
+#
+# # service ipv6mon start bge0
+#
. /etc/rc.subr
name="ipv6mon"
rcvar="${name}_enable"
command="%%PREFIX%%/sbin/${name}"
-pidfile="/var/run/${name}.pid"
required_files="%%PREFIX%%/etc/${name}.conf"
+start_precmd="start_precmd"
+: ${ipv6mon_enable:=NO}
+
+start_precmd()
+{
+ for ifn in $ipv6mon_interfaces; do
+ (grep -v "LockFile=\|AddressLogFile=\|NetworkInterface=" \
+ %%PREFIX%%/etc/${name}.conf
+ echo "NetworkInterface=${ifn}"
+ echo "LockFile=/var/run/${name}-${ifn}.pid"
+ echo "AddressLogFile=/var/log/${name}-${ifn}.log"
+ ) > "/var/run/${name}-${ifn}.conf"
+ done
+}
load_rc_config $name
-run_rc_command "$1"
+
+case ${2:-$ipv6mon_interfaces} in
+"")
+ pidfile="/var/run/${name}.pid"
+ run_rc_command "$1"
+;;
+*)
+ for ifn in ${2:-$ipv6mon_interfaces}; do
+ pidfile="/var/run/${name}${ifn:+-}${ifn}.pid"
+ command_args="$command_args \
+ -c /var/run/${name}${ifn:+-}${ifn}.conf"
+ run_rc_command "$1"
+ done
+;;
+esac
Modified: head/net-mgmt/ipv6mon/pkg-descr
==============================================================================
--- head/net-mgmt/ipv6mon/pkg-descr Mon Sep 15 15:53:58 2014 (r368272)
+++ head/net-mgmt/ipv6mon/pkg-descr Mon Sep 15 16:11:39 2014 (r368273)
@@ -5,4 +5,4 @@ where address assignment is decentralize
server that records which IPv6 addresses have been assigned to which
nodes during which period of time.
-WWW: http://www.si6networks.com/tools/ipv6mon/
+WWW: http://www.si6networks.com/tools/ipv6mon/
More information about the svn-ports-head
mailing list