diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2014-09-15 16:11:39 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2014-09-15 16:11:39 +0000 |
commit | 8e8b8e16ba17cef86f014a958be966fd96eaeec5 (patch) | |
tree | adf02d4fa4e45c18b2beb20f29be41a32b05c82e /net-mgmt/ipv6mon | |
parent | 438dcd27fed5941b67ac225570628c8d85729fa2 (diff) |
Notes
Diffstat (limited to 'net-mgmt/ipv6mon')
-rw-r--r-- | net-mgmt/ipv6mon/Makefile | 12 | ||||
-rw-r--r-- | net-mgmt/ipv6mon/files/Makefile | 19 | ||||
-rw-r--r-- | net-mgmt/ipv6mon/files/ipv6mon.in | 44 | ||||
-rw-r--r-- | net-mgmt/ipv6mon/files/patch-Makefile | 19 | ||||
-rw-r--r-- | net-mgmt/ipv6mon/pkg-descr | 2 |
5 files changed, 66 insertions, 30 deletions
diff --git a/net-mgmt/ipv6mon/Makefile b/net-mgmt/ipv6mon/Makefile index 7752b4e00afc..cab81e3117d9 100644 --- a/net-mgmt/ipv6mon/Makefile +++ b/net-mgmt/ipv6mon/Makefile @@ -1,9 +1,8 @@ -# Created by: Hiroki Sato <hrs@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@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: diff --git a/net-mgmt/ipv6mon/files/Makefile b/net-mgmt/ipv6mon/files/Makefile new file mode 100644 index 000000000000..661ab4e9a625 --- /dev/null +++ b/net-mgmt/ipv6mon/files/Makefile @@ -0,0 +1,19 @@ +# $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> diff --git a/net-mgmt/ipv6mon/files/ipv6mon.in b/net-mgmt/ipv6mon/files/ipv6mon.in index 6d01cba6bbb5..2353c801bcc5 100644 --- a/net-mgmt/ipv6mon/files/ipv6mon.in +++ b/net-mgmt/ipv6mon/files/ipv6mon.in @@ -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 diff --git a/net-mgmt/ipv6mon/files/patch-Makefile b/net-mgmt/ipv6mon/files/patch-Makefile deleted file mode 100644 index 61d6e50f446b..000000000000 --- a/net-mgmt/ipv6mon/files/patch-Makefile +++ /dev/null @@ -1,19 +0,0 @@ ---- /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> diff --git a/net-mgmt/ipv6mon/pkg-descr b/net-mgmt/ipv6mon/pkg-descr index 374e710509d4..c9970a714146 100644 --- a/net-mgmt/ipv6mon/pkg-descr +++ b/net-mgmt/ipv6mon/pkg-descr @@ -5,4 +5,4 @@ where address assignment is decentralized and there is no central 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/ |