From 992c828dd664565a41464eb206fd503025de0b53 Mon Sep 17 00:00:00 2001 From: Munechika SUMIKAWA Date: Wed, 18 Aug 2004 02:04:15 +0000 Subject: [PATCH] Add rc scripts. Submitted by: ume --- net/dhcp6/Makefile | 14 +++++++++++++- net/dhcp6/files/dhcp6c.sh | 36 +++++++++++++++++++++++++++++++++++ net/dhcp6/files/dhcp6relay.sh | 35 ++++++++++++++++++++++++++++++++++ net/dhcp6/files/dhcp6s.sh | 36 +++++++++++++++++++++++++++++++++++ net/dhcp6/pkg-plist | 13 ++++++++----- 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 net/dhcp6/files/dhcp6c.sh create mode 100644 net/dhcp6/files/dhcp6relay.sh create mode 100644 net/dhcp6/files/dhcp6s.sh diff --git a/net/dhcp6/Makefile b/net/dhcp6/Makefile index 3e6d029da261..ba9f58d4cf4c 100644 --- a/net/dhcp6/Makefile +++ b/net/dhcp6/Makefile @@ -7,7 +7,7 @@ PORTNAME= dhcp6 PORTVERSION= 20040816a -CATEGORIES= net +CATEGORIES= net ipv6 MASTER_SITES= ftp://ftp.kame.net/pub/kame/misc/ DISTNAME= kame-${PORTNAME}-${PORTVERSION} @@ -15,6 +15,7 @@ MAINTAINER= sumikawa@FreeBSD.org COMMENT= KAME DHCP6 client and server WRKSRC= ${WRKDIR}/${PORTNAME} +USE_RC_SUBR= yes GNU_CONFIGURE= yes CONFIGURE_ARGS+= --sysconfdir=${LOCALBASE}/etc --with-localdbdir=/var/db USE_REINPLACE= yes @@ -22,11 +23,19 @@ USE_REINPLACE= yes MAN5= dhcp6c.conf.5 dhcp6s.conf.5 MAN8= dhcp6c.8 dhcp6s.8 dhcp6relay.8 dhcp6sctl.8 +RC_SCRIPTS= dhcp6c.sh dhcp6relay.sh dhcp6s.sh +RC_SCRIPTS_SUB= PREFIX=${PREFIX} \ + RC_SUBR=${RC_SUBR} + post-patch: .for file in ${MAN5} ${MAN8} ${REINPLACE_CMD} -e 's|/usr/local/v6/etc|${LOCALBASE}/etc|' \ ${WRKSRC}/${file} .endfor +.for f in ${RC_SCRIPTS} + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/${f} > ${WRKDIR}/${f} +.endfor post-install: .if !defined(NOPORTDOCS) @@ -35,5 +44,8 @@ post-install: .endif ${INSTALL_DATA} ${WRKSRC}/dhcp6c.conf.sample ${PREFIX}/etc ${INSTALL_DATA} ${WRKSRC}/dhcp6s.conf.sample ${PREFIX}/etc +.for f in ${RC_SCRIPTS} + @${INSTALL_SCRIPT} ${WRKDIR}/${f} ${PREFIX}/etc/rc.d/${f} +.endfor .include diff --git a/net/dhcp6/files/dhcp6c.sh b/net/dhcp6/files/dhcp6c.sh new file mode 100644 index 000000000000..32117d128bf4 --- /dev/null +++ b/net/dhcp6/files/dhcp6c.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dhcp6c +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move dhcp6c.sh to /etc/rc.d/dhcp6c + +prefix=%%PREFIX%% + +# Define these dhcp6c_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dhcp6c +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dhcp6c_enable=${dhcp6c_enable:-"NO"} # Enable dhcp6c +#dhcp6c_program="${prefix}/sbin/${name}" # Location of dhcp6c +#dhcp6c_flags="fxp0" # Flags to dhcp6c program + +. %%RC_SUBR%% + +name="dhcp6c" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +required_files="${prefix}/etc/${name}.conf" + +load_rc_config $name +run_rc_command "$1" diff --git a/net/dhcp6/files/dhcp6relay.sh b/net/dhcp6/files/dhcp6relay.sh new file mode 100644 index 000000000000..bff8d9815a2d --- /dev/null +++ b/net/dhcp6/files/dhcp6relay.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dhcp6relay +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move dhcp6relay.sh to /etc/rc.d/dhcp6relay + +prefix=%%PREFIX%% + +# Define these dhcp6relay_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dhcp6relay +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dhcp6relay_enable=${dhcp6relay_enable:-"NO"} # Enable dhcp6relay +#dhcp6relay_program="${prefix}/sbin/${name}" # Location of dhcp6relay +#dhcp6relay_flags="-r fxp1 fxp0" # Flags to dhcp6relay program + +. %%RC_SUBR%% + +name="dhcp6relay" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" + +load_rc_config $name +run_rc_command "$1" diff --git a/net/dhcp6/files/dhcp6s.sh b/net/dhcp6/files/dhcp6s.sh new file mode 100644 index 000000000000..603ed4a5eb30 --- /dev/null +++ b/net/dhcp6/files/dhcp6s.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dhcp6s +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown +# +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move dhcp6s.sh to /etc/rc.d/dhcp6s + +prefix=%%PREFIX%% + +# Define these dhcp6s_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dhcp6s +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dhcp6s_enable=${dhcp6s_enable:-"NO"} # Enable dhcp6s +#dhcp6s_program="${prefix}/sbin/${name}" # Location of dhcp6s +#dhcp6s_flags="fxp0" # Flags to dhcp6s program + +. %%RC_SUBR%% + +name="dhcp6s" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +required_files="${prefix}/etc/${name}.conf" + +load_rc_config $name +run_rc_command "$1" diff --git a/net/dhcp6/pkg-plist b/net/dhcp6/pkg-plist index 463a48fe5b5c..686ab85dfb34 100644 --- a/net/dhcp6/pkg-plist +++ b/net/dhcp6/pkg-plist @@ -1,9 +1,12 @@ -sbin/dhcp6c -sbin/dhcp6s -sbin/dhcp6relay -sbin/dhcp6sctl etc/dhcp6s.conf.sample etc/dhcp6c.conf.sample -%%PORTDOCS%%%%DOCSDIR%%/README +etc/rc.d/dhcp6c.sh +etc/rc.d/dhcp6relay.sh +etc/rc.d/dhcp6s.sh +sbin/dhcp6c +sbin/dhcp6relay +sbin/dhcp6s +sbin/dhcp6sctl %%PORTDOCS%%%%DOCSDIR%%/COPYRIGHT +%%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%@dirrm %%DOCSDIR%%