Bug 136845 - [PATCH] net/ifdepd: USE_RC_SUBR != yes
Summary: [PATCH] net/ifdepd: USE_RC_SUBR != yes
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Philip M. Gollucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-17 08:20 UTC by Philip M. Gollucci
Modified: 2009-07-17 19:50 UTC (History)
1 user (show)

See Also:


Attachments
ifdepd-20050420_1.patch (1.87 KB, patch)
2009-07-17 08:20 UTC, Philip M. Gollucci
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip M. Gollucci freebsd_committer freebsd_triage 2009-07-17 08:20:03 UTC
Added file(s):
- files/ifdepd.in

Port maintainer (alex@hugo.bmg.gv.at) is cc'd.

Generated with FreeBSD Port Tools 0.77
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-17 08:21:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-17 08:21:21 UTC
Maintainer of net/ifdepd,

Please note that PR ports/136845 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/136845

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-17 08:21:22 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 alex 2009-07-17 10:21:34 UTC
Hi,

this patch has only one small problem, the following line should also be 
removed from files/patch-Makefile

+                       ${BSD_INSTALL_SCRIPT} ${PROG}.sh ${PREFIX}/etc/rc.d

The corrected patch should look like this:

--- ifdepd-20050420_1.patch begins here ---
diff -N -u -r ../ifdepd.old/Makefile ./Makefile
--- Makefile	2009-01-05 22:36:39.000000000 +0100
+++ Makefile	2009-07-17 10:18:49.579118295 +0200
@@ -5,6 +5,7 @@
 
 PORTNAME=	ifdepd
 PORTVERSION=	20050420
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	http://alex.bmg.gv.at/programs/
 
@@ -13,15 +14,9 @@
 
 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 -N -u -r ../ifdepd.old/files/ifdepd.in ./files/ifdepd.in
--- files/ifdepd.in	1970-01-01 01:00:00.000000000 +0100
+++ files/ifdepd.in	2009-07-17 10:18:49.614412166 +0200
@@ -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 -N -u -r ../ifdepd.old/files/patch-Makefile ./files/patch-Makefile
--- files/patch-Makefile	2005-04-22 20:53:12.000000000 +0200
+++ files/patch-Makefile	2009-07-17 10:39:13.400922801 +0200
@@ -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}
@@ -22,7 +22,6 @@
 -.endif
 -			${INSTALL} -o root -g wheel -m 644 ${MAN8} ${PREFIX}/man/man8
 +			${BSD_INSTALL_PROGRAM} ${PROG} ${PREFIX}/bin
-+			${BSD_INSTALL_SCRIPT} ${PROG}.sh ${PREFIX}/etc/rc.d
 +			${BSD_INSTALL_MAN} ${MAN8} ${PREFIX}/man/man8
  
  deinstall:
--- ifdepd-20050420_1.patch ends here ---

Shall I open an new PR or can you commit the patch from this?

regards

Alex

------
Alexander Hauser
alex@hugo.bmg.gv.at
Comment 5 Philip M. Gollucci freebsd_committer freebsd_triage 2009-07-17 17:05:15 UTC
State Changed
From-To: feedback->open

Maintainer has approved.
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-07-17 19:41:26 UTC
pgollucci    2009-07-17 18:41:08 UTC

  FreeBSD ports repository

  Modified files:
    net/ifdepd           Makefile 
    net/ifdepd/files     patch-Makefile 
  Added files:
    net/ifdepd/files     ifdepd.in 
  Log:
  - USE_RC_SUBR != yes
  
  PR:             ports/136845
  Approved by:    maintainer
  Submitted by:   myself (pgollucci@)
  
  Revision  Changes    Path
  1.5       +3 -8      ports/net/ifdepd/Makefile
  1.1       +45 -0     ports/net/ifdepd/files/ifdepd.in (new)
  1.2       +11 -4     ports/net/ifdepd/files/patch-Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Philip M. Gollucci freebsd_committer freebsd_triage 2009-07-17 19:45:33 UTC
State Changed
From-To: open->closed

Committed. Thanks! 

We do need to bump PORTREVISION the pkg-plist changed
(vpmsd.sh -> vpmsd)