From 62b0232d32a5c4c001a09a2f268ebafebf5b6421 Mon Sep 17 00:00:00 2001 From: nork Date: Mon, 31 May 2010 16:43:38 +0000 Subject: Cleanup rc script, and bump PORTREVISION. Submitted by: dougb --- databases/flare/Makefile | 4 +-- databases/flare/files/flared.in | 51 +++++++++++++++++++++++++++++++ databases/flare/files/flared.sh.in | 54 --------------------------------- databases/flare/files/flarei.in | 57 +++++++++++++++++++++++++++++++++++ databases/flare/files/flarei.sh.in | 61 -------------------------------------- 5 files changed, 110 insertions(+), 117 deletions(-) create mode 100644 databases/flare/files/flared.in delete mode 100644 databases/flare/files/flared.sh.in create mode 100644 databases/flare/files/flarei.in delete mode 100644 databases/flare/files/flarei.sh.in diff --git a/databases/flare/Makefile b/databases/flare/Makefile index 05b7e00bde77..e826b8eb491b 100644 --- a/databases/flare/Makefile +++ b/databases/flare/Makefile @@ -7,7 +7,7 @@ PORTNAME= flare PORTVERSION= 1.0.9 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= databases MASTER_SITES= http://labs.gree.jp/data/source/ EXTRACT_SUFX= .tgz @@ -24,7 +24,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING GNU_CONFIGURE= yes CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -DHAVE_KQUEUE" LDFLAGS=-L${LOCALBASE}/lib -USE_RC_SUBR= flared.sh flarei.sh +USE_RC_SUBR= flared flarei SUB_FILES= pkg-message MAKE_JOBS_SAFE= yes diff --git a/databases/flare/files/flared.in b/databases/flare/files/flared.in new file mode 100644 index 000000000000..633e8af21259 --- /dev/null +++ b/databases/flare/files/flared.in @@ -0,0 +1,51 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: flared +# REQUIRE: LOGIN flarei +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# flared_enable (bool): Set to NO by default. +# Set it to YES to enable flared. +# flared_config (path): Set to %%PREFIX%%/etc/flared.conf by default. +# + +. /etc/rc.subr + +name=flared +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/${name} +extra_commands="reload" +start_precmd=${name}_prestart + +flared_prestart () { + case "$flared_flags" in + *-p\ *|*--pid\ *) + err 1 "\$flared_flags includes -p option." \ + "Please use \$flared_pidfile instead." + ;; + esac + + case "$flared_flags" in + *-f\ *|*--config\ *) + err 1 "\$flared_flags includes -f option." \ + "Please use \$flared_config instead." + ;; + esac +} + +load_rc_config $name + +: flared_enable=${flared_enable-"NO"} +: flared_config=${flared_config-"%%PREFIX%%/etc/${name}.conf"} +: flared_pidfile=${flared_pidfile-"/var/run/${name}.pid"} + +pidfile=$flared_pidfile +required_files=$flared_config +command_args="--daemonize --config $flared_config --pid $pidfile" + +run_rc_command "$1" diff --git a/databases/flare/files/flared.sh.in b/databases/flare/files/flared.sh.in deleted file mode 100644 index a037afcb625f..000000000000 --- a/databases/flare/files/flared.sh.in +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: flared -# REQUIRE: LOGIN flarei -# -flared_enable=${flared_enable-"NO"} -flared_config=${flared_conffile-"%%PREFIX%%/etc/flared.conf"} -flared_pidfile=${flared_pidfile-"/var/run/flared.pid"} -flared_flags="--daemonize" - -. /etc/rc.subr - -name=flared -rcvar=`set_rcvar` -command=%%PREFIX%%/bin/${name} - -extra_commands="reload" - -load_rc_config ${name} - -case "${flared_flags}" in -*-p\ *) - echo "Warning: \$flared_flags includes -p option." \ - "Please use \$flared_pidfile instead." - ;; -*--pid\ *) - echo "Warning: \$flared_flags includes -p option." \ - "Please use \$flared_pidfile instead." - ;; -*) - flared_flags="--pid ${flared_pidfile} ${flared_flags}" - ;; -esac - -case "${flared_flags}" in -*-f\ *) - echo "Warning: \$flared_flags includes -f option." \ - "Please use \$flared_config instead." - ;; -*--config\ *) - echo "Warning: \$flared_flags includes --config option." \ - "Please use \$flared_config instead." - ;; -*) - flared_flags="--config ${flared_config} ${flared_flags}" - ;; -esac - -pidfile=${flared_pidfile} -required_files=${flared_conffile} - -run_rc_command "$1" diff --git a/databases/flare/files/flarei.in b/databases/flare/files/flarei.in new file mode 100644 index 000000000000..2b83a0e13a76 --- /dev/null +++ b/databases/flare/files/flarei.in @@ -0,0 +1,57 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: flarei +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# flarei_enable (bool): Set to NO by default. +# Set it to YES to enable flarei. +# flarei_config (path): Set to %%PREFIX%%/etc/flarei.conf by default. +# + +. /etc/rc.subr + +name=flarei +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/${name} +extra_commands="reload" +start_precmd=${name}_prestart +start_postcmd=${name}_poststart + +flarei_prestart () { + case "$flarei_flags" in + *-p\ *|*--pid\ *) + err 1 "\$flarei_flags includes -p option." \ + "Please use \$flarei_pidfile instead." + ;; + esac + + case "$flarei_flags" in + *-f\ *|*--config\ *) + err 1 "\$flarei_flags includes -f option." \ + "Please use \$flarei_config instead." + ;; + esac +} + +flarei_poststart () { + sleep "$flarei_sleepwait" +} + +load_rc_config $name + +: flarei_enable=${flarei_enable-"NO"} +: flarei_config=${flarei_config-"%%PREFIX%%/etc/${name}.conf"} +: flarei_pidfile=${flarei_pidfile-"/var/run/${name}.pid"} +: flarei_sleepwait=${flarei_sleepwait-2} + +pidfile=$flarei_pidfile +required_files=$flarei_config +command_args="--daemonize --config $flarei_config --pid $pidfile" + +run_rc_command "$1" diff --git a/databases/flare/files/flarei.sh.in b/databases/flare/files/flarei.sh.in deleted file mode 100644 index 9ca2a39f6a2f..000000000000 --- a/databases/flare/files/flarei.sh.in +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: flarei -# REQUIRE: LOGIN -# BEFORE: flared -# -flarei_enable=${flarei_enable-"NO"} -flarei_config=${flarei_conffile-"%%PREFIX%%/etc/flarei.conf"} -flarei_pidfile=${flarei_pidfile-"/var/run/flarei.pid"} -flarei_flags="--daemonize" -flarei_sleepwait="2" - -. /etc/rc.subr - -name=flarei -rcvar=`set_rcvar` -command=%%PREFIX%%/bin/${name} - -extra_commands="reload" -start_postcmd="flarei_poststart" - -flarei_poststart () { - sleep "${flarei_sleepwait}" -} - -load_rc_config ${name} - -case "${flarei_flags}" in -*-p\ *) - echo "Warning: \$flarei_flags includes -p option." \ - "Please use \$flarei_pidfile instead." - ;; -*--pid\ *) - echo "Warning: \$flarei_flags includes -p option." \ - "Please use \$flarei_pidfile instead." - ;; -*) - flarei_flags="--pid ${flarei_pidfile} ${flarei_flags}" - ;; -esac - -case "${flarei_flags}" in -*-f\ *) - echo "Warning: \$flarei_flags includes -f option." \ - "Please use \$flarei_config instead." - ;; -*--config\ *) - echo "Warning: \$flarei_flags includes --config option." \ - "Please use \$flarei_config instead." - ;; -*) - flarei_flags="--config ${flarei_config} ${flarei_flags}" - ;; -esac - -pidfile=${flarei_pidfile} -required_files=${flarei_conffile} - -run_rc_command "$1" -- cgit