summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgollucci <pgollucci@FreeBSD.org>2009-07-17 18:41:08 +0000
committerpgollucci <pgollucci@FreeBSD.org>2009-07-17 18:41:08 +0000
commit44470041b48d54482cb3c8aa27bb147aa4d2afdf (patch)
treec542ee2d855210abc16fab95ccae7f0da4c0036f
parentb5504e8fb07cb543baf958697ecfd01c8e9de88a (diff)
downloadFreeBSD-ports-44470041b48d54482cb3c8aa27bb147aa4d2afdf.zip
FreeBSD-ports-44470041b48d54482cb3c8aa27bb147aa4d2afdf.tar.gz
- USE_RC_SUBR != yes
PR: ports/136845 Approved by: maintainer Submitted by: myself (pgollucci@)
-rw-r--r--net/ifdepd/Makefile11
-rw-r--r--net/ifdepd/files/ifdepd.in45
-rw-r--r--net/ifdepd/files/patch-Makefile15
3 files changed, 59 insertions, 12 deletions
diff --git a/net/ifdepd/Makefile b/net/ifdepd/Makefile
index 4d97ae4..1039167 100644
--- a/net/ifdepd/Makefile
+++ b/net/ifdepd/Makefile
@@ -5,6 +5,7 @@
PORTNAME= ifdepd
PORTVERSION= 20050420
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://alex.bmg.gv.at/programs/
@@ -13,15 +14,9 @@ COMMENT= Interface Dependancy daemon
MAN8= ifdepd.8
-PLIST_FILES= bin/ifdepd \
- etc/rc.d/ifdepd.sh
+PLIST_FILES= bin/ifdepd
-USE_RC_SUBR= yes
-
-post-patch:
- @${REINPLACE_CMD} -e \
- 's|/etc/rc\.subr|${RC_SUBR}|; s|/usr/local|${PREFIX}|' \
- ${WRKSRC}/ifdepd.sh
+USE_RC_SUBR= ${PORTNAME}
post-install:
@${CAT} ${PKGMESSAGE}
diff --git a/net/ifdepd/files/ifdepd.in b/net/ifdepd/files/ifdepd.in
new file mode 100644
index 0000000..43d7594
--- /dev/null
+++ b/net/ifdepd/files/ifdepd.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+
+# PROVIDE: ifdepd
+# REQUIRE: netif routing
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable ifdepd:
+#
+#ifdepd_enable="YES"
+#ifdepd_src_ifaces="em0:em1"
+#ifdepd_dst_ifaces="carp1"
+
+. /etc/rc.subr
+
+name="ifdepd"
+rcvar=`set_rcvar`
+command="/usr/local/bin/ifdepd"
+start_cmd="ifdepd_start"
+stop_cmd="ifdepd_stop"
+
+ifdepd_enable=${ifdepd_enable:-"NO"}
+load_rc_config $name
+
+ifdepd_start()
+{
+ echo 'Starting ifdepd.'
+ ifdepd_src_ifaces=`echo $ifdepd_src_ifaces | sed -E 's/[ \t]+/:/g'`
+ ifdepd_dst_ifaces=`echo $ifdepd_dst_ifaces | sed -E 's/[ \t]+/:/g'`
+ if checkyesno ${rcvar} && [ "x${ifdepd_src_ifaces}" != "x" ] &&
+ [ "x${ifdepd_dst_ifaces}" != "x" ]; then
+ $command -d -S ${ifdepd_src_ifaces} -D ${ifdepd_dst_ifaces}
+ else
+ warn '$ifdepd_ifaces is not set.'
+ fi
+}
+
+ifdepd_stop()
+{
+ echo 'Stopping ifdepd.'
+ killall ifdepd
+}
+
+run_rc_command "$1"
diff --git a/net/ifdepd/files/patch-Makefile b/net/ifdepd/files/patch-Makefile
index 3440d0c..15a6509 100644
--- a/net/ifdepd/files/patch-Makefile
+++ b/net/ifdepd/files/patch-Makefile
@@ -1,5 +1,5 @@
---- Makefile.orig Wed Apr 20 15:30:18 2005
-+++ Makefile Fri Apr 22 16:12:43 2005
+--- ./Makefile.orig 2005-04-20 09:30:18.000000000 -0400
++++ ./Makefile 2009-07-17 14:38:38.391992090 -0400
@@ -4,10 +4,8 @@
PROG = ifdepd
RM = rm -f
@@ -12,7 +12,7 @@
MAN8 = ifdepd.8
OBJ = ifdepd.o
-@@ -22,18 +20,14 @@
+@@ -22,18 +20,13 @@
${RM} *.o ${PROJ} *.core core ${PROG} tags *.err
install: ${PROG}
@@ -29,8 +29,15 @@
${RM} ${PREFIX}/bin/${PROG}
${RM} ${PREFIX}/man/man8/${PROG}.8
-.if ${OSTYPE}!="OpenBSD"
- ${RM} ${PREFIX}/etc/rc.d/${PROG}.sh
+- ${RM} ${PREFIX}/etc/rc.d/${PROG}.sh
-.endif
${PROG}: ${OBJ}
${CC} ${CFLAGS} -o ${PROG} ${OBJ} ${LIBS}
+@@ -41,4 +34,4 @@
+ %.o: %.cc %.H %.h
+ $(CCXX) $(CXXFLAGS) -c $<
+
+-#.include <bsd.prog.mk>
+\ No newline at end of file
++#.include <bsd.prog.mk>
OpenPOWER on IntegriCloud