summaryrefslogtreecommitdiff
path: root/inputmethod/sj3-server-bin/files
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-05 04:55:23 +0000
committerjlam <jlam@pkgsrc.org>2006-07-05 04:55:23 +0000
commitcc4ac9bbccc2fea65aa034fa8e79035512b82ac5 (patch)
treeb5c019d07a13a58aa3f6b4fafd49a7ab8498460a /inputmethod/sj3-server-bin/files
parent366f3b7f81ee1faebd5affba8e805bbcde568651 (diff)
downloadpkgsrc-cc4ac9bbccc2fea65aa034fa8e79035512b82ac5.tar.gz
* Convert to USE_TOOLS+=itools instead of including nbitools/buildlink3.mk.
* Fully convert to pkginstall framework by properly using OWN_DIRS* to manage required directories during package installation and deinstallation. * Drop the need to explicitly set PREFIX in the package Makefiles. We now install into ${LOCALBASE} like all other pkgsrc packages and use symlinks and file copies to put the right files into ${IMDICTDIR}. * Change default dependency relationship in sj3-lib/buildlink3.mk to a build dependency since it the package only installs headers and a static library archive. * Move some important setup instructions from the DESCR file to MESSAGE files so that the admin will see them at package installation. * Rewrite the sj3 rc.d script so that all necessary directories are created before the daemon is started. * Miscellaneous touch ups to the DESCR and MESSAGE files. Bump the PKGREVISIONs on the sj3* packages.
Diffstat (limited to 'inputmethod/sj3-server-bin/files')
-rw-r--r--inputmethod/sj3-server-bin/files/sj3.sh38
1 files changed, 26 insertions, 12 deletions
diff --git a/inputmethod/sj3-server-bin/files/sj3.sh b/inputmethod/sj3-server-bin/files/sj3.sh
index 856749f5473..745cc890cc7 100644
--- a/inputmethod/sj3-server-bin/files/sj3.sh
+++ b/inputmethod/sj3-server-bin/files/sj3.sh
@@ -1,23 +1,37 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: sj3.sh,v 1.1 2003/07/31 12:33:03 jmmv Exp $
+# $NetBSD: sj3.sh,v 1.2 2006/07/05 04:55:24 jlam Exp $
#
# PROVIDE: sj3
# REQUIRE: LOGIN
#
-if [ -f /etc/rc.subr ]; then
- . /etc/rc.subr
-fi
+. /etc/rc.subr
name="sj3"
-rcvar="${name}"
+rcvar=$name
command="@PREFIX@/bin/sj3serv"
+start_precmd="sj3_prestart"
-if [ -f /etc/rc.subr ]; then
- load_rc_config "${name}"
- run_rc_command "$1"
-else
- printf " sj3"
- eval ${command} ${sj3_flags} ${command_args}
-fi
+mkdir_perms() {
+ dir="$1"; user="$2"; group="$3"; mode="$4"
+ @TEST@ -d $dir || @MKDIR@ $dir
+ @CHOWN@ $user $dir
+ @CHGRP@ $group $dir
+ @CHMOD@ $mode $dir
+}
+
+sj3_prestart()
+{
+ @MKDIR@ @IMDICTDIR@/sj3
+ mkdir_perms @IMDICTDIR@/sj3/user @SJ3OWNER@ @SJ3GROUP@ 0755
+ srcdict="@PREFIX@/libdata/sj3main.dic"
+ dict="@IMDICTDIR@/sj3/sj3main.dic"
+ if @TEST@ -f $srcdict; then
+ @RM@ -f $srcdict
+ @LN@ -fs $srcdict $dict
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"