USE_RC_SUBR'ify.

This commit is contained in:
Akinori MUSHA 2004-05-10 18:39:05 +00:00
parent fcc83fd470
commit 72d8a1325c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=108863
3 changed files with 41 additions and 44 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= esecanna
PORTVERSION= 1.0.1
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= japanese
MASTER_SITES= http://esecanna.netfort.gr.jp/ \
${MASTER_SITE_LOCAL}
@ -18,23 +18,19 @@ DIST_SUBDIR= esecanna
MAINTAINER= knu@FreeBSD.org
COMMENT= Pseudo cannaserver which wraps some other input engines
USE_RC_SUBR= yes
USE_REINPLACE= yes
USE_AUTOCONF_VER= 213
USE_GMAKE= yes
CONFIGURE_ARGS= --with-piddir="${PIDDIR}"
PIDDIR= /var/run/esecanna
STARTER= esecanna.sh
DOCS= CREDITS CHANGES.jp README.First.jp README.jp
PLIST_SUB= STARTER="${STARTER}"
post-extract:
${SED} -e " \
s,!!PREFIX!!,${PREFIX},g; \
s,!!STARTER!!,${STARTER},g; \
" \
${FILESDIR}/esecanna.sh > ${WRKSRC}/${STARTER}
${SED} -e 's,%%PREFIX%%,${PREFIX},g' -e 's,%%RC_SUBR%%,${RC_SUBR},g' \
${FILESDIR}/esecanna.sh > ${WRKSRC}/esecanna.sh
post-patch:
${REINPLACE_CMD} -e " \
@ -44,7 +40,7 @@ post-patch:
${WRKSRC}/esecannarc
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/${STARTER} ${PREFIX}/etc/rc.d/
${INSTALL_SCRIPT} ${WRKSRC}/esecanna.sh ${PREFIX}/etc/rc.d/
${MKDIR} ${PREFIX}/lib/esecanna
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/doc/esecanna

View File

@ -2,40 +2,41 @@
#
# $FreeBSD$
esecannaserver="!!PREFIX!!/sbin/esecannaserver"
piddir="/var/run/esecanna"
# PROVIDE: esecanna
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
case "$1" in
start)
if [ -f !!PREFIX!!/vje30/.version ] \
&& grep -qw 'FREE TRIAL VERSION' !!PREFIX!!/vje30/.version; then
echo ''
echo 'esecanna:'
echo ' Using VJE-Delta 3.0 trial, it is unable to connect to vjed on startup.'
echo ' Please execute $esecannaserver manually after once you run vje.'
exit 1
. %%RC_SUBR%%
name=esecanna
rcvar=`set_rcvar`
esecannaserver=%%PREFIX%%/sbin/esecannaserver
# XXX
command=/usr/bin/nohup
command_args=">/dev/null $esecannaserver"
procname=$esecannaserver
pidfile=/var/run/esecanna/esecanna.pid
esecanna_chdir="$(dirname $pidfile)"
required_files=%%PREFIX%%/etc/esecannarc
start_precmd="esecanna_prestart"
[ -z "$esecanna_enable" ] && esecanna_enable=NO
esecanna_prestart () {
if [ -f %%PREFIX%%/vje30/.version ] \
&& grep -qw 'FREE TRIAL VERSION' %%PREFIX%%/vje30/.version; then
echo '** Using VJE-Delta 3.0 trial, it is unable to connect to vjed on startup.'
echo '** Please execute $esecannaserver manually after once you run vje.'
exit 255
fi
if [ -x $esecannaserver ]; then
rm -f /tmp/.iroha_unix/IROHA
echo -n ' esecanna: '
cd $piddir
nohup $esecannaserver
fi
;;
stop)
pidfile=$piddir/esecanna.pid
if [ -f $pidfile ]; then
kill `cat $pidfile` && echo -n ' esecanna'
rm $pidfile
else
echo ' esecanna: not running'
fi
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
/bin/rm -f /tmp/.iroha_unix/IROHA
}
exit 0
load_rc_config $name
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
@unexec if [ -x %D/etc/rc.d/esecanna.sh ]; then %D/etc/rc.d/esecanna.sh stop || true; fi
etc/esecannarc
etc/rc.d/%%STARTER%%
etc/rc.d/esecanna.sh
@exec mkdir -p %D/lib/esecanna
@dirrm lib/esecanna
sbin/esecannaserver