1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00

RcNG'ize the startup script (and bump the port revision).

Submitted by:	ume
This commit is contained in:
Masafumi Max NAKANE 2004-02-16 06:37:22 +00:00
parent 2a96f151b3
commit d1c4fdec2f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=101008
12 changed files with 168 additions and 102 deletions

View File

@ -8,6 +8,7 @@
PORTNAME= Canna
PORTVERSION= 3.7p1
PORTREVISION= 1
CATEGORIES= japanese
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= canna/7449/
@ -16,6 +17,7 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.//g}
MAINTAINER= max@FreeBSD.org
COMMENT= Kana-Kanji conversion system
USE_RC_SUBR= yes
USE_BZIP2= yes
USE_IMAKE= yes
USE_X_PREFIX= no
@ -46,9 +48,10 @@ PORTDOCS= canna.bib canna.sty Imakefile README.jp Makefile \
.endif
post-build:
@${SED} -e "s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
@${SED} -e "s,@PREFIX@,${PREFIX},g; s,@RC_SUBR@,${RC_SUBR},g; \
s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
s,@CHOWN@,${CHOWN},g" ${FILESDIR}/canna.sh.in \
> ${WRKDIR}/canna.sh.sample
> ${WRKDIR}/canna.sh
post-install:
.for f in user user/user group
@ -56,8 +59,8 @@ post-install:
@${CHOWN} bin:bin ${PREFIX}/lib/canna/dic/$f
@${CHMOD} 775 ${PREFIX}/lib/canna/dic/$f
.endfor
@${ECHO} "Installing a sample startup script as ${PREFIX}/etc/rc.d/canna.sh.sample."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh.sample ${PREFIX}/etc/rc.d/canna.sh.sample
@${ECHO} "Installing a startup script as ${PREFIX}/etc/rc.d/canna.sh."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh ${PREFIX}/etc/rc.d/canna.sh
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.if !defined(NOPORTDOCS)

View File

@ -1,32 +1,44 @@
#!/bin/sh
#
# $FreeBSD$
#
OPTIONS="-u bin"
# Uncomment the following if you want to use a TCP connection
# instead of a UNIX domain socket.
#OPTIONS="-u bin -inet"
# PROVIDE: canna
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 64
fi
# Define these canna_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/canna
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
canna_enable=${canna_enable:-"NO"} # Enable canna
#canna_program="@PREFIX@/sbin/cannaserver" # Location of canna
canna_flags=${canna_flags:-"-u bin"} # Flags to canna program
# Put the following into /etc/rc.conf if you want to use a TCP
# connection instead of a UNIX domain socket.
#canna_flags="-u bin -inet"
. @RC_SUBR@
case "$1" in
start)
if [ -x ${PREFIX}/sbin/cannaserver ]; then
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
${PREFIX}/sbin/cannaserver ${OPTIONS} && echo -n ' canna'
fi
;;
stop)
${PREFIX}/sbin/cannakill && echo -n ' canna'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
name="canna"
rcvar=`set_rcvar`
command="@PREFIX@/sbin/cannaserver"
start_precmd="canna_prestart"
stop_cmd="canna_stop"
exit 0
canna_prestart() {
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
}
canna_stop() {
@PREFIX@/sbin/cannakill && echo "Stopping ${name}."
}
load_rc_config $name
run_rc_command "$1"

View File

@ -1,6 +1,13 @@
Now the cannaserver uses a UNIX domain scoekt by default. If you need
to use a TCP connection, please edit your startup script
(e.g. /usr/local/etc/rc.d/canna.sh) and add the -inet command-line
option to the cannaserver execution.
to use a TCP connection, please edit your /etc/rc.conf (or alike) nad
add -inet command-line option to canna_flags, i.e.:
canna_flags="-u bin -inet"
Also, note that canna startup script now uses the rcNG mechanism, so
if you'd like to start Canna server on local system, enable it in your
/etc/rc.conf, i.e.:
canna_enable="yes"

View File

@ -29,7 +29,7 @@ bin/rmdic
bin/splitword
bin/syncdic
bin/wtoc
etc/rc.d/canna.sh.sample
etc/rc.d/canna.sh
include/canna/RK.h
include/canna/jrkanji.h
include/canna/keydef.h

View File

@ -8,6 +8,7 @@
PORTNAME= Canna
PORTVERSION= 3.7p1
PORTREVISION= 1
CATEGORIES= japanese
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= canna/7449/
@ -16,6 +17,7 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.//g}
MAINTAINER= max@FreeBSD.org
COMMENT= Kana-Kanji conversion system
USE_RC_SUBR= yes
USE_BZIP2= yes
USE_IMAKE= yes
USE_X_PREFIX= no
@ -46,9 +48,10 @@ PORTDOCS= canna.bib canna.sty Imakefile README.jp Makefile \
.endif
post-build:
@${SED} -e "s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
@${SED} -e "s,@PREFIX@,${PREFIX},g; s,@RC_SUBR@,${RC_SUBR},g; \
s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
s,@CHOWN@,${CHOWN},g" ${FILESDIR}/canna.sh.in \
> ${WRKDIR}/canna.sh.sample
> ${WRKDIR}/canna.sh
post-install:
.for f in user user/user group
@ -56,8 +59,8 @@ post-install:
@${CHOWN} bin:bin ${PREFIX}/lib/canna/dic/$f
@${CHMOD} 775 ${PREFIX}/lib/canna/dic/$f
.endfor
@${ECHO} "Installing a sample startup script as ${PREFIX}/etc/rc.d/canna.sh.sample."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh.sample ${PREFIX}/etc/rc.d/canna.sh.sample
@${ECHO} "Installing a startup script as ${PREFIX}/etc/rc.d/canna.sh."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh ${PREFIX}/etc/rc.d/canna.sh
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.if !defined(NOPORTDOCS)

View File

@ -1,32 +1,44 @@
#!/bin/sh
#
# $FreeBSD$
#
OPTIONS="-u bin"
# Uncomment the following if you want to use a TCP connection
# instead of a UNIX domain socket.
#OPTIONS="-u bin -inet"
# PROVIDE: canna
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 64
fi
# Define these canna_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/canna
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
canna_enable=${canna_enable:-"NO"} # Enable canna
#canna_program="@PREFIX@/sbin/cannaserver" # Location of canna
canna_flags=${canna_flags:-"-u bin"} # Flags to canna program
# Put the following into /etc/rc.conf if you want to use a TCP
# connection instead of a UNIX domain socket.
#canna_flags="-u bin -inet"
. @RC_SUBR@
case "$1" in
start)
if [ -x ${PREFIX}/sbin/cannaserver ]; then
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
${PREFIX}/sbin/cannaserver ${OPTIONS} && echo -n ' canna'
fi
;;
stop)
${PREFIX}/sbin/cannakill && echo -n ' canna'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
name="canna"
rcvar=`set_rcvar`
command="@PREFIX@/sbin/cannaserver"
start_precmd="canna_prestart"
stop_cmd="canna_stop"
exit 0
canna_prestart() {
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
}
canna_stop() {
@PREFIX@/sbin/cannakill && echo "Stopping ${name}."
}
load_rc_config $name
run_rc_command "$1"

View File

@ -1,6 +1,13 @@
Now the cannaserver uses a UNIX domain scoekt by default. If you need
to use a TCP connection, please edit your startup script
(e.g. /usr/local/etc/rc.d/canna.sh) and add the -inet command-line
option to the cannaserver execution.
to use a TCP connection, please edit your /etc/rc.conf (or alike) nad
add -inet command-line option to canna_flags, i.e.:
canna_flags="-u bin -inet"
Also, note that canna startup script now uses the rcNG mechanism, so
if you'd like to start Canna server on local system, enable it in your
/etc/rc.conf, i.e.:
canna_enable="yes"

View File

@ -29,7 +29,7 @@ bin/rmdic
bin/splitword
bin/syncdic
bin/wtoc
etc/rc.d/canna.sh.sample
etc/rc.d/canna.sh
include/canna/RK.h
include/canna/jrkanji.h
include/canna/keydef.h

View File

@ -8,6 +8,7 @@
PORTNAME= Canna
PORTVERSION= 3.7p1
PORTREVISION= 1
CATEGORIES= japanese
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= canna/7449/
@ -16,6 +17,7 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.//g}
MAINTAINER= max@FreeBSD.org
COMMENT= Kana-Kanji conversion system
USE_RC_SUBR= yes
USE_BZIP2= yes
USE_IMAKE= yes
USE_X_PREFIX= no
@ -46,9 +48,10 @@ PORTDOCS= canna.bib canna.sty Imakefile README.jp Makefile \
.endif
post-build:
@${SED} -e "s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
@${SED} -e "s,@PREFIX@,${PREFIX},g; s,@RC_SUBR@,${RC_SUBR},g; \
s,@RM@,${RM},g; s,@TOUCH@,${TOUCH},g; \
s,@CHOWN@,${CHOWN},g" ${FILESDIR}/canna.sh.in \
> ${WRKDIR}/canna.sh.sample
> ${WRKDIR}/canna.sh
post-install:
.for f in user user/user group
@ -56,8 +59,8 @@ post-install:
@${CHOWN} bin:bin ${PREFIX}/lib/canna/dic/$f
@${CHMOD} 775 ${PREFIX}/lib/canna/dic/$f
.endfor
@${ECHO} "Installing a sample startup script as ${PREFIX}/etc/rc.d/canna.sh.sample."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh.sample ${PREFIX}/etc/rc.d/canna.sh.sample
@${ECHO} "Installing a startup script as ${PREFIX}/etc/rc.d/canna.sh."
@${INSTALL_SCRIPT} ${WRKDIR}/canna.sh ${PREFIX}/etc/rc.d/canna.sh
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.if !defined(NOPORTDOCS)

View File

@ -1,32 +1,44 @@
#!/bin/sh
#
# $FreeBSD$
#
OPTIONS="-u bin"
# Uncomment the following if you want to use a TCP connection
# instead of a UNIX domain socket.
#OPTIONS="-u bin -inet"
# PROVIDE: canna
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 64
fi
# Define these canna_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/canna
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
canna_enable=${canna_enable:-"NO"} # Enable canna
#canna_program="@PREFIX@/sbin/cannaserver" # Location of canna
canna_flags=${canna_flags:-"-u bin"} # Flags to canna program
# Put the following into /etc/rc.conf if you want to use a TCP
# connection instead of a UNIX domain socket.
#canna_flags="-u bin -inet"
. @RC_SUBR@
case "$1" in
start)
if [ -x ${PREFIX}/sbin/cannaserver ]; then
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
${PREFIX}/sbin/cannaserver ${OPTIONS} && echo -n ' canna'
fi
;;
stop)
${PREFIX}/sbin/cannakill && echo -n ' canna'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
name="canna"
rcvar=`set_rcvar`
command="@PREFIX@/sbin/cannaserver"
start_precmd="canna_prestart"
stop_cmd="canna_stop"
exit 0
canna_prestart() {
@RM@ -f /tmp/.iroha_unix/IROHA
@TOUCH@ /var/log/CANNA0msgs
@CHOWN@ bin:bin /var/log/CANNA0msgs
}
canna_stop() {
@PREFIX@/sbin/cannakill && echo "Stopping ${name}."
}
load_rc_config $name
run_rc_command "$1"

View File

@ -1,6 +1,13 @@
Now the cannaserver uses a UNIX domain scoekt by default. If you need
to use a TCP connection, please edit your startup script
(e.g. /usr/local/etc/rc.d/canna.sh) and add the -inet command-line
option to the cannaserver execution.
to use a TCP connection, please edit your /etc/rc.conf (or alike) nad
add -inet command-line option to canna_flags, i.e.:
canna_flags="-u bin -inet"
Also, note that canna startup script now uses the rcNG mechanism, so
if you'd like to start Canna server on local system, enable it in your
/etc/rc.conf, i.e.:
canna_enable="yes"

View File

@ -29,7 +29,7 @@ bin/rmdic
bin/splitword
bin/syncdic
bin/wtoc
etc/rc.d/canna.sh.sample
etc/rc.d/canna.sh
include/canna/RK.h
include/canna/jrkanji.h
include/canna/keydef.h