From ff326c507fd75c76cf26b20407e5593ed942c706 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Thu, 10 Feb 2005 19:12:56 +0000 Subject: use new scheme of USE_RC_SUBR. --- net/dtcp/Makefile | 22 ++++-------- net/dtcp/files/dtcpc.sh | 41 ----------------------- net/dtcp/files/dtcpc.sh.in | 41 +++++++++++++++++++++++ net/dtcp/files/dtcps.sh | 63 ----------------------------------- net/dtcp/files/dtcps.sh.in | 63 +++++++++++++++++++++++++++++++++++ net/dtcpclient/Makefile | 14 ++------ net/dtcpclient/files/dtcpclient.sh | 40 ---------------------- net/dtcpclient/files/dtcpclient.sh.in | 40 ++++++++++++++++++++++ net/dtcpclient/pkg-plist | 1 - 9 files changed, 153 insertions(+), 172 deletions(-) delete mode 100644 net/dtcp/files/dtcpc.sh create mode 100644 net/dtcp/files/dtcpc.sh.in delete mode 100644 net/dtcp/files/dtcps.sh create mode 100644 net/dtcp/files/dtcps.sh.in delete mode 100644 net/dtcpclient/files/dtcpclient.sh create mode 100644 net/dtcpclient/files/dtcpclient.sh.in diff --git a/net/dtcp/Makefile b/net/dtcp/Makefile index e67e13348115..72907ef5f4bf 100644 --- a/net/dtcp/Makefile +++ b/net/dtcp/Makefile @@ -19,18 +19,16 @@ COMMENT= Dynamic Tunnel Configuration Protocol daemon and client RUN_DEPENDS= qpopauth:${PORTSDIR}/mail/qpopper .endif -USE_RC_SUBR= yes +USE_RC_SUBR= dtcpc.sh dtcps.sh USE_RUBY= yes MAKE_ENV+= RUBY=${RUBY} MAN8= dtcpauth.8 dtcpc.8 dtcps.8 MANCOMPRESSED= yes -RC_SCRIPTS= ${PREFIX}/etc/rc.d/dtcpc.sh ${PREFIX}/etc/rc.d/dtcps.sh -RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} RUBY=${RUBY} +SUB_LIST+= RUBY=${RUBY} -PLIST_FILES= sbin/dtcpauth sbin/dtcpc sbin/dtcps \ - etc/rc.d/dtcpc.sh etc/rc.d/dtcps.sh +PLIST_FILES= sbin/dtcpauth sbin/dtcpc sbin/dtcps pre-everything:: .if !defined(DTCP_CLIENT_ONLY) @@ -41,19 +39,11 @@ pre-everything:: .endif pre-install: - @for script in ${RC_SCRIPTS}; do \ - if [ -f $${script} ]; then \ - ${ECHO_MSG} "Remove old $${script} before install."; \ + @for script in ${USE_RC_SUBR}; do \ + if [ -f ${PREFIX}/etc/rc.d/$${script} ]; then \ + ${ECHO_MSG} "Remove old ${PREFIX}/etc/rc.d/$${script} before install."; \ exit 1; \ fi; \ done -post-install: - @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ - ${FILESDIR}/dtcpc.sh > ${PREFIX}/etc/rc.d/dtcpc.sh - @${CHMOD} ${BINMODE} ${PREFIX}/etc/rc.d/dtcpc.sh - @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ - ${FILESDIR}/dtcps.sh > ${PREFIX}/etc/rc.d/dtcps.sh - @${CHMOD} ${BINMODE} ${PREFIX}/etc/rc.d/dtcps.sh - .include diff --git a/net/dtcp/files/dtcpc.sh b/net/dtcp/files/dtcpc.sh deleted file mode 100644 index 3ca23c039e83..000000000000 --- a/net/dtcp/files/dtcpc.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: dtcpc -# 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 dtcpc.sh to /etc/rc.d/dtcpc - -prefix=%%PREFIX%% - -# Define these dtcpc_* variables in one of these files: -# /etc/rc.conf -# /etc/rc.conf.local -# /etc/rc.conf.d/dtcpc -# -# DO NOT CHANGE THESE DEFAULT VALUES HERE -# -dtcpc_enable=${dtcpc_enable:-"NO"} # Enable dtcpc -#dtcpc_program="${prefix}/sbin/dtcpc" # Location of dtcpc -dtcpc_server=${dtcpc_server:-""} # DTCP server name -dtcpc_username=${dtcpc_username:-""} # DTCP user name -dtcpc_flags=${dtcpc_flags:-"-t network -Dl"} # Flags to dtcpc program - -. %%RC_SUBR%% - -name="dtcpc" -rcvar=`set_rcvar` -command="${prefix}/sbin/${name}" -command_interpreter="%%RUBY%%" -pidfile="/var/run/${name}.pid" -extra_commands="reload" - -load_rc_config $name -command_args="-u ${dtcpc_username} ${dtcpc_server}" -run_rc_command "$1" diff --git a/net/dtcp/files/dtcpc.sh.in b/net/dtcp/files/dtcpc.sh.in new file mode 100644 index 000000000000..3ca23c039e83 --- /dev/null +++ b/net/dtcp/files/dtcpc.sh.in @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dtcpc +# 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 dtcpc.sh to /etc/rc.d/dtcpc + +prefix=%%PREFIX%% + +# Define these dtcpc_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dtcpc +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dtcpc_enable=${dtcpc_enable:-"NO"} # Enable dtcpc +#dtcpc_program="${prefix}/sbin/dtcpc" # Location of dtcpc +dtcpc_server=${dtcpc_server:-""} # DTCP server name +dtcpc_username=${dtcpc_username:-""} # DTCP user name +dtcpc_flags=${dtcpc_flags:-"-t network -Dl"} # Flags to dtcpc program + +. %%RC_SUBR%% + +name="dtcpc" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +command_interpreter="%%RUBY%%" +pidfile="/var/run/${name}.pid" +extra_commands="reload" + +load_rc_config $name +command_args="-u ${dtcpc_username} ${dtcpc_server}" +run_rc_command "$1" diff --git a/net/dtcp/files/dtcps.sh b/net/dtcp/files/dtcps.sh deleted file mode 100644 index a2e3ad9c9b1a..000000000000 --- a/net/dtcp/files/dtcps.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: dtcps -# 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 dtcps.sh to /etc/rc.d/dtcps - -prefix=%%PREFIX%% - -# Define these dtcps_* variables in one of these files: -# /etc/rc.conf -# /etc/rc.conf.local -# /etc/rc.conf.d/dtcps -# -# DO NOT CHANGE THESE DEFAULT VALUES HERE -# -dtcps_enable=${dtcps_enable:-"NO"} # Enable dtcps -#dtcps_program="${prefix}/sbin/dtcps" # Location of dtcps -dtcps_tunif=${dtcps_tunif:-""} # tunnel interface -dtcps_prefix=${dtcps_prefix:-""} # prefix for host tunnel type -dtcps_flags=${dtcps_flags:-""} # Flags to dtcps program - -# interface cloning example -#dtcps_tunif='gif70' - -# static allocation example -#dtcps_unit_min=70 -#dtcps_unit_max=79 -#dtcps_tunif='gif7[0-9]' - -# prefix for host tunnel type. -# YOU MUST CHANGE TO ASSIGN THIS WITHIN YOUR ADDRESS BLOCK. -#dtcps_prefix='3ffe:501:185b:8000::' - -. %%RC_SUBR%% - -name="dtcps" -rcvar=`set_rcvar` -command="${prefix}/sbin/${name}" -command_interpreter="%%RUBY%%" -pidfile="/var/run/${name}.pid" -start_precmd="dtcps_prestart" - -dtcps_prestart() { - if [ -n "${dtcps_unit_min}" -a -n "${dtcps_unit_max}" ]; then - unit=${dtcps_unit_min} - while [ ${unit} -le ${dtcps_unit_max} ]; do - ifconfig gif${unit} create >/dev/null 2>&1 - unit=$((${unit}+1)) - done - fi -} - -load_rc_config $name -command_args="-i ${dtcps_tunif} ${dtcps_prefix}" -run_rc_command "$1" diff --git a/net/dtcp/files/dtcps.sh.in b/net/dtcp/files/dtcps.sh.in new file mode 100644 index 000000000000..a2e3ad9c9b1a --- /dev/null +++ b/net/dtcp/files/dtcps.sh.in @@ -0,0 +1,63 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dtcps +# 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 dtcps.sh to /etc/rc.d/dtcps + +prefix=%%PREFIX%% + +# Define these dtcps_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dtcps +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dtcps_enable=${dtcps_enable:-"NO"} # Enable dtcps +#dtcps_program="${prefix}/sbin/dtcps" # Location of dtcps +dtcps_tunif=${dtcps_tunif:-""} # tunnel interface +dtcps_prefix=${dtcps_prefix:-""} # prefix for host tunnel type +dtcps_flags=${dtcps_flags:-""} # Flags to dtcps program + +# interface cloning example +#dtcps_tunif='gif70' + +# static allocation example +#dtcps_unit_min=70 +#dtcps_unit_max=79 +#dtcps_tunif='gif7[0-9]' + +# prefix for host tunnel type. +# YOU MUST CHANGE TO ASSIGN THIS WITHIN YOUR ADDRESS BLOCK. +#dtcps_prefix='3ffe:501:185b:8000::' + +. %%RC_SUBR%% + +name="dtcps" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +command_interpreter="%%RUBY%%" +pidfile="/var/run/${name}.pid" +start_precmd="dtcps_prestart" + +dtcps_prestart() { + if [ -n "${dtcps_unit_min}" -a -n "${dtcps_unit_max}" ]; then + unit=${dtcps_unit_min} + while [ ${unit} -le ${dtcps_unit_max} ]; do + ifconfig gif${unit} create >/dev/null 2>&1 + unit=$((${unit}+1)) + done + fi +} + +load_rc_config $name +command_args="-i ${dtcps_tunif} ${dtcps_prefix}" +run_rc_command "$1" diff --git a/net/dtcpclient/Makefile b/net/dtcpclient/Makefile index ae7f48f3e661..a597ef7ef847 100644 --- a/net/dtcpclient/Makefile +++ b/net/dtcpclient/Makefile @@ -15,23 +15,15 @@ MASTER_SITES= http://www.imasy.or.jp/~ume/ipv6/ \ MAINTAINER= ume@FreeBSD.org COMMENT= Dynamic Tunnel Configuration Protocol client -USE_RC_SUBR= yes +USE_RC_SUBR= dtcpclient.sh MAN8= dtcpclient.8 MANCOMPRESSED= yes -RC_SCRIPT= ${PREFIX}/etc/rc.d/dtcpclient.sh -RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} - pre-install: - @if [ -f ${RC_SCRIPT} ]; then \ - ${ECHO_CMD} "Remove old ${RC_SCRIPT} before install."; \ + @if [ -f ${PREFIX}/etc/rc.d/${USE_RC_SUBR} ]; then \ + ${ECHO_CMD} "Remove old ${PREFIX}/etc/rc.d/${USE_RC_SUBR} before install."; \ exit 1; \ fi -post-install: - @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ - ${FILESDIR}/dtcpclient.sh > ${WRKDIR}/dtcpclient.sh - @${INSTALL_SCRIPT} ${WRKDIR}/dtcpclient.sh ${RC_SCRIPT} - .include diff --git a/net/dtcpclient/files/dtcpclient.sh b/net/dtcpclient/files/dtcpclient.sh deleted file mode 100644 index e8b0ee65658d..000000000000 --- a/net/dtcpclient/files/dtcpclient.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: dtcpclient -# 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 dtcpclient.sh to /etc/rc.d/dtcpclient - -prefix=%%PREFIX%% - -# Define these dtcpclient_* variables in one of these files: -# /etc/rc.conf -# /etc/rc.conf.local -# /etc/rc.conf.d/dtcpclient -# -# DO NOT CHANGE THESE DEFAULT VALUES HERE -# -dtcpclient_enable=${dtcpclient_enable:-"NO"} # Enable dtcpclient -#dtcpclient_program="${prefix}/sbin/dtcpclient" # Location of dtcpclient -dtcpclient_server=${dtcpclient_server:-""} # DTCP server name -dtcpclient_username=${dtcpclient_username:-""} # DTCP user name -dtcpclient_flags=${dtcpclient_flags:-"-t network -Dl"} # Flags to dtcpclient program - -. %%RC_SUBR%% - -name="dtcpclient" -rcvar=`set_rcvar` -command="${prefix}/sbin/${name}" -pidfile="/var/run/${name}.pid" -extra_commands="reload" - -load_rc_config $name -command_args="-u ${dtcpclient_username} ${dtcpclient_server}" -run_rc_command "$1" diff --git a/net/dtcpclient/files/dtcpclient.sh.in b/net/dtcpclient/files/dtcpclient.sh.in new file mode 100644 index 000000000000..e8b0ee65658d --- /dev/null +++ b/net/dtcpclient/files/dtcpclient.sh.in @@ -0,0 +1,40 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: dtcpclient +# 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 dtcpclient.sh to /etc/rc.d/dtcpclient + +prefix=%%PREFIX%% + +# Define these dtcpclient_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/dtcpclient +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +dtcpclient_enable=${dtcpclient_enable:-"NO"} # Enable dtcpclient +#dtcpclient_program="${prefix}/sbin/dtcpclient" # Location of dtcpclient +dtcpclient_server=${dtcpclient_server:-""} # DTCP server name +dtcpclient_username=${dtcpclient_username:-""} # DTCP user name +dtcpclient_flags=${dtcpclient_flags:-"-t network -Dl"} # Flags to dtcpclient program + +. %%RC_SUBR%% + +name="dtcpclient" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +pidfile="/var/run/${name}.pid" +extra_commands="reload" + +load_rc_config $name +command_args="-u ${dtcpclient_username} ${dtcpclient_server}" +run_rc_command "$1" diff --git a/net/dtcpclient/pkg-plist b/net/dtcpclient/pkg-plist index 9b38dc4333b4..38249fc2b36d 100644 --- a/net/dtcpclient/pkg-plist +++ b/net/dtcpclient/pkg-plist @@ -3,4 +3,3 @@ sbin/dtcpclient %%EXAMPLESDIR%%/dtcpclient.script @exec [ -f %D/etc/dtcpclient.script ] || cp %B/%f %D/etc/dtcpclient.script @dirrm %%EXAMPLESDIR%% -etc/rc.d/dtcpclient.sh -- cgit v1.2.3