aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2006-02-20 02:48:34 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2006-02-20 02:48:34 +0000
commit2b53c53222c144b262481f64d362e25c151aaea9 (patch)
tree88ef9eefa5e52e1be1b1049df1465a510e6313d9 /net-mgmt
parent56655e7197a4f0120b71b5268ea26668f9fe1d95 (diff)
downloadports-2b53c53222c144b262481f64d362e25c151aaea9.tar.gz
ports-2b53c53222c144b262481f64d362e25c151aaea9.zip
- Preserve modified config file
- Respect MANPREFIX - Use new rc.d script - Bump PORTREVISION PR: 93574 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=156459
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/ipcad/Makefile18
-rw-r--r--net-mgmt/ipcad/files/ipcad.in31
-rw-r--r--net-mgmt/ipcad/files/ipcad.sh.tmpl19
-rw-r--r--net-mgmt/ipcad/files/pkg-message.in (renamed from net-mgmt/ipcad/pkg-message)7
-rw-r--r--net-mgmt/ipcad/pkg-plist3
5 files changed, 46 insertions, 32 deletions
diff --git a/net-mgmt/ipcad/Makefile b/net-mgmt/ipcad/Makefile
index d94eea6259a4..740267523e4c 100644
--- a/net-mgmt/ipcad/Makefile
+++ b/net-mgmt/ipcad/Makefile
@@ -7,6 +7,7 @@
PORTNAME= ipcad
PORTVERSION= 3.7
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
http://ipcad.sourceforge.net/ \
@@ -16,10 +17,13 @@ MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= vlm@lionet.info
COMMENT= IP accounting daemon with Cisco-like RSH and NetFlow export modes
+USE_RC_SUBR= ipcad
+SUB_FILES= pkg-message
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
MANCOMPRESSED= no
-MAN5= ipcad.conf.5
-MAN8= ipcad.8
-USE_REINPLACE= yes
+MAN5= ipcad.conf.5
+MAN8= ipcad.8
post-patch:
@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g ; \
@@ -27,12 +31,8 @@ post-patch:
post-install:
@${STRIP_CMD} ${PREFIX}/bin/ipcad
- @${SED} -e "s=!!PREFIX!!=${PREFIX}=g" \
- < ${FILESDIR}/ipcad.sh.tmpl \
- > ${PREFIX}/etc/rc.d/ipcad.sh
- @${CHOWN} ${BINOWN}:${BINGRP} ${PREFIX}/etc/rc.d/ipcad.sh
- ${INSTALL_MAN} ${WRKSRC}/ipcad.8 ${PREFIX}/man/man8
- ${INSTALL_MAN} ${WRKSRC}/ipcad.conf.5 ${PREFIX}/man/man5
+ ${INSTALL_MAN} ${WRKSRC}/ipcad.8 ${MANPREFIX}/man/man8
+ ${INSTALL_MAN} ${WRKSRC}/ipcad.conf.5 ${MANPREFIX}/man/man5
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/net-mgmt/ipcad/files/ipcad.in b/net-mgmt/ipcad/files/ipcad.in
new file mode 100644
index 000000000000..0e459f0ca7f3
--- /dev/null
+++ b/net-mgmt/ipcad/files/ipcad.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: ipcad
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf to run ipcad:
+#
+# ipcad_enable (bool): Set it to "YES" to enable ipcad.
+# Default is "NO".
+# ipcad_conf (file): Set local of config file.
+# Default is "%%PREFIX%%/etc/ipcad.conf".
+#
+
+. %%RC_SUBR%%
+
+name="ipcad"
+rcvar=${name}_enable
+
+load_rc_config ${name}
+
+: ${ipcad_enable="NO"}
+: ${ipcad_conf="%%PREFIX%%/etc/ipcad.conf"}
+: ${ipcad_flags=""}
+
+required_files="${ipcad_conf}"
+command=%%PREFIX%%/bin/ipcad
+command_args="-rds -c ${ipcad_conf}"
+
+run_rc_command "$1"
diff --git a/net-mgmt/ipcad/files/ipcad.sh.tmpl b/net-mgmt/ipcad/files/ipcad.sh.tmpl
deleted file mode 100644
index 6fda2ff21dce..000000000000
--- a/net-mgmt/ipcad/files/ipcad.sh.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# ipcad startup script example.
-
-case "$1" in
-start)
- if [ -x !!PREFIX!!/bin/ipcad -a -f !!PREFIX!!/etc/ipcad.conf ]; then
- !!PREFIX!!/bin/ipcad -rds && echo -n ' ipcad'
- fi
- ;;
-stop)
- /usr/bin/killall ipcad && /bin/echo -n ' ipcad'
- ;;
-*)
- /bin/echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
diff --git a/net-mgmt/ipcad/pkg-message b/net-mgmt/ipcad/files/pkg-message.in
index dc55f70a3eac..3145c2cedd23 100644
--- a/net-mgmt/ipcad/pkg-message
+++ b/net-mgmt/ipcad/files/pkg-message.in
@@ -1,7 +1,10 @@
===========================================================================
-To configure this package, customize ${PREFIX}/etc/ipcad.conf from
-${PREFIX}/etc/ipcad.conf.sample, then start `ipcad -rds`
+To enable rc.d script to startup ipcad, please add ipcad_enable="YES"
+in your rc.conf
+
+To configure this package, customize %%PREFIX%%/etc/ipcad.conf from
+%%PREFIX%%/etc/ipcad.conf.sample, then start via rc.d script
You should be able to do `rsh localhost sh ip accounting` after that.
===========================================================================
diff --git a/net-mgmt/ipcad/pkg-plist b/net-mgmt/ipcad/pkg-plist
index 83056ee8bfb8..bc5dce833189 100644
--- a/net-mgmt/ipcad/pkg-plist
+++ b/net-mgmt/ipcad/pkg-plist
@@ -1,5 +1,4 @@
bin/ipcad
-etc/ipcad.conf
+@unexec if cmp -s %D/etc/ipcad.conf %D/etc/ipcad.conf.default; then rm -f %D/etc/ipcad.conf; fi
etc/ipcad.conf.default
etc/ipcad.conf.simple
-etc/rc.d/ipcad.sh