aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/canna-lib
diff options
context:
space:
mode:
authormax <max@FreeBSD.org>2004-02-16 14:37:22 +0800
committermax <max@FreeBSD.org>2004-02-16 14:37:22 +0800
commit415173eb854b69af4db3e21ec4334fda049fb5f8 (patch)
tree46bcf11d773434fba7661576006ae3ba0228557e /japanese/canna-lib
parent58ffc7c23389de5727aced4a96710228e5c2ecac (diff)
downloadfreebsd-ports-gnome-415173eb854b69af4db3e21ec4334fda049fb5f8.tar.gz
freebsd-ports-gnome-415173eb854b69af4db3e21ec4334fda049fb5f8.tar.zst
freebsd-ports-gnome-415173eb854b69af4db3e21ec4334fda049fb5f8.zip
RcNG'ize the startup script (and bump the port revision).
Submitted by: ume
Diffstat (limited to 'japanese/canna-lib')
-rw-r--r--japanese/canna-lib/Makefile11
-rw-r--r--japanese/canna-lib/files/canna.sh.in64
-rw-r--r--japanese/canna-lib/pkg-message13
-rw-r--r--japanese/canna-lib/pkg-plist2
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