diff options
author | Masafumi Max NAKANE <max@FreeBSD.org> | 2004-02-16 06:37:22 +0000 |
---|---|---|
committer | Masafumi Max NAKANE <max@FreeBSD.org> | 2004-02-16 06:37:22 +0000 |
commit | d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0 (patch) | |
tree | c3172c5f92044f888e72d2cec028ac91c36d50eb /japanese/canna-lib | |
parent | 2a96f151b3c72b039d097aa2ee7b03da506e98e2 (diff) | |
download | ports-d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0.tar.gz ports-d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0.zip |
Notes
Diffstat (limited to 'japanese/canna-lib')
-rw-r--r-- | japanese/canna-lib/Makefile | 11 | ||||
-rw-r--r-- | japanese/canna-lib/files/canna.sh.in | 64 | ||||
-rw-r--r-- | japanese/canna-lib/pkg-message | 13 | ||||
-rw-r--r-- | japanese/canna-lib/pkg-plist | 2 |
4 files changed, 56 insertions, 34 deletions
diff --git a/japanese/canna-lib/Makefile b/japanese/canna-lib/Makefile index 636f9e4c13a1..b20d67de6cd4 100644 --- a/japanese/canna-lib/Makefile +++ b/japanese/canna-lib/Makefile @@ -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) diff --git a/japanese/canna-lib/files/canna.sh.in b/japanese/canna-lib/files/canna.sh.in index 1595ca688f9f..6881832fb165 100644 --- a/japanese/canna-lib/files/canna.sh.in +++ b/japanese/canna-lib/files/canna.sh.in @@ -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" diff --git a/japanese/canna-lib/pkg-message b/japanese/canna-lib/pkg-message index a5d66bc6769f..3a82ac1502ea 100644 --- a/japanese/canna-lib/pkg-message +++ b/japanese/canna-lib/pkg-message @@ -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" diff --git a/japanese/canna-lib/pkg-plist b/japanese/canna-lib/pkg-plist index 107b6d59d2e0..3a51e34c0952 100644 --- a/japanese/canna-lib/pkg-plist +++ b/japanese/canna-lib/pkg-plist @@ -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 |