ports/143155: [PATCH] net/zebra: use $SUB_FILES to dynamically update zebractl

Sevan Janiyan venture37 at geeklan.co.uk
Sun Jan 24 08:50:01 UTC 2010


>Number:         143155
>Category:       ports
>Synopsis:       [PATCH] net/zebra: use $SUB_FILES to dynamically update zebractl
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 24 08:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Sevan Janiyan
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD newbie.thingamajig-systems.co.uk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 21:11:58 UTC
>Description:
no need to invoke sed manually

Added file(s):
- files/zebractl.in

Removed file(s):
- files/zebractl.sh

Port maintainer (sumikawa at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- zebra-0.95a_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/zebra/Makefile,v
retrieving revision 1.87
diff -u -r1.87 Makefile
--- Makefile	8 Jan 2009 17:53:06 -0000	1.87
+++ Makefile	24 Jan 2010 08:43:38 -0000
@@ -20,8 +20,7 @@
 
 CONFLICTS=	openbgpd-[0-9]* quagga-[0-9]*
 
-PKGMESSAGE=	${WRKDIR}/pkg-message
-SUB_FILES=	pkg-message
+SUB_FILES=	pkg-message zebractl
 USE_SUBMAKE=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=	--sysconfdir=${PREFIX}/etc/zebra
@@ -43,7 +42,7 @@
 MAN8=		bgpd.8 ospf6d.8 ospfd.8 ripd.8 ripngd.8 zebra.8
 INFO=		zebra
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
 
 .if ${OSVERSION} >= 800059
 BROKEN=		does not build
@@ -115,13 +114,12 @@
 PLIST_SUB+=	VTYSH="@comment "
 .endif
 
+.include <bsd.port.pre.mk>
+
 post-install:
 	@( cd ${WRKSRC}/doc; ${RM} -f zebra*info*; ${MAKE} zebra.info install )
 	@${ECHO} "===>     installing zebra startup file..."
-	@${SED} -e "s=!!PREFIX!!=${PREFIX}=" \
-		< ${FILESDIR}/zebractl.sh  \
-		> ${PREFIX}/sbin/zebractl
-	@${CHMOD} 555 ${PREFIX}/sbin/zebractl
+	${INSTALL_SCRIPT} ${WRKDIR}/zebractl ${PREFIX}/sbin/zebractl
 	@${ECHO} "done."
 	@${CAT} ${PKGMESSAGE}
 
Index: files/zebractl.in
===================================================================
RCS file: files/zebractl.in
diff -N files/zebractl.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/zebractl.in	24 Jan 2010 08:43:38 -0000
@@ -0,0 +1,57 @@
+#! /bin/sh
+#
+# $FreeBSD: ports/net/zebra/files/zebractl.sh,v 1.8 2002/08/04 20:04:50 sumikawa Exp $
+#
+# zebra start/stop script by "Andreas Klemm <andreas at FreeBSD.ORG>"
+#
+
+usage()
+{
+	echo "$0: usage: $0 [ start | stop | restart ]"
+	exit 1
+}
+
+if [ $# -lt 1 ]; then
+	echo "$0: error: one argument needed"; usage
+elif [ $# -gt 1 ]; then
+	echo "$0: error: only one argument needed"; usage
+fi
+
+case $1 in
+	start)
+		if [ ! -f %%ETCDIR%%/zebra.conf ]; then
+			echo "error: zebra.conf config file is mandatory"
+			exit 1
+		fi
+		[ -f %%ETCDIR%%/zebra.conf ] \
+			&& %%PREFIX%%/sbin/zebra -d && echo -n ' zebra'
+		[ -f %%ETCDIR%%/ripd.conf ] \
+			&& %%PREFIX%%/sbin/ripd -d && echo -n ' ripd'
+		[ -f %%ETCDIR%%/ripngd.conf ] \
+			&& %%PREFIX%%/sbin/ripngd -d && echo -n ' ripngd'
+		[ -f %%ETCDIR%%/ospfd.conf ] \
+			&& %%PREFIX%%/sbin/ospfd -d && echo -n ' ospfd'
+		[ -f %%ETCDIR%%/ospf6d.conf ] \
+			&& %%PREFIX%%/sbin/ospf6d -d && echo -n ' ospf6d'
+		[ -f %%ETCDIR%%/bgpd.conf ] \
+			&& %%PREFIX%%/sbin/bgpd -d && echo -n ' bgpd'
+		;;
+
+	stop)
+		[ -f %%ETCDIR%%/ripd.conf ] && killall ripd
+		[ -f %%ETCDIR%%/ripngd.conf ] && killall ripngd
+		[ -f %%ETCDIR%%/ospfd.conf ] && killall ospfd
+		[ -f %%ETCDIR%%/ospf6d.conf ] && killall ospf6d
+		[ -f %%ETCDIR%%/bgpd.conf ] && killall bgpd
+		[ -f %%ETCDIR%%/zebra.conf ] &&  killall zebra
+		;;
+	restart)
+		$0 stop
+		$0 start
+		;;
+
+	*)	echo "$0: error: unknown option $1"
+		usage
+		;;
+esac
+exit 0
Index: files/zebractl.sh
===================================================================
RCS file: files/zebractl.sh
diff -N files/zebractl.sh
--- files/zebractl.sh	4 Aug 2002 20:04:50 -0000	1.8
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,57 +0,0 @@
-#! /bin/sh
-#
-# $FreeBSD: ports/net/zebra/files/zebractl.sh,v 1.8 2002/08/04 20:04:50 sumikawa Exp $
-#
-# zebra start/stop script by "Andreas Klemm <andreas at FreeBSD.ORG>"
-#
-
-usage()
-{
-	echo "$0: usage: $0 [ start | stop | restart ]"
-	exit 1
-}
-
-if [ $# -lt 1 ]; then
-	echo "$0: error: one argument needed"; usage
-elif [ $# -gt 1 ]; then
-	echo "$0: error: only one argument needed"; usage
-fi
-
-case $1 in
-	start)
-		if [ ! -f !!PREFIX!!/etc/zebra/zebra.conf ]; then
-			echo "error: zebra.conf config file is mandatory"
-			exit 1
-		fi
-		[ -f !!PREFIX!!/etc/zebra/zebra.conf ] \
-			&& !!PREFIX!!/sbin/zebra -d && echo -n ' zebra'
-		[ -f !!PREFIX!!/etc/zebra/ripd.conf ] \
-			&& !!PREFIX!!/sbin/ripd -d && echo -n ' ripd'
-		[ -f !!PREFIX!!/etc/zebra/ripngd.conf ] \
-			&& !!PREFIX!!/sbin/ripngd -d && echo -n ' ripngd'
-		[ -f !!PREFIX!!/etc/zebra/ospfd.conf ] \
-			&& !!PREFIX!!/sbin/ospfd -d && echo -n ' ospfd'
-		[ -f !!PREFIX!!/etc/zebra/ospf6d.conf ] \
-			&& !!PREFIX!!/sbin/ospf6d -d && echo -n ' ospf6d'
-		[ -f !!PREFIX!!/etc/zebra/bgpd.conf ] \
-			&& !!PREFIX!!/sbin/bgpd -d && echo -n ' bgpd'
-		;;
-
-	stop)
-		[ -f !!PREFIX!!/etc/zebra/ripd.conf ] && killall ripd
-		[ -f !!PREFIX!!/etc/zebra/ripngd.conf ] && killall ripngd
-		[ -f !!PREFIX!!/etc/zebra/ospfd.conf ] && killall ospfd
-		[ -f !!PREFIX!!/etc/zebra/ospf6d.conf ] && killall ospf6d
-		[ -f !!PREFIX!!/etc/zebra/bgpd.conf ] && killall bgpd
-		[ -f !!PREFIX!!/etc/zebra/zebra.conf ] &&  killall zebra
-		;;
-	restart)
-		$0 stop
-		$0 start
-		;;
-
-	*)	echo "$0: error: unknown option $1"
-		usage
-		;;
-esac
-exit 0
--- zebra-0.95a_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list