Subject: pkg/11963: apply the new "rc.d" scheme to FreeWnn's startup script
To: None <gnats-bugs@gnats.netbsd.org>
From: None <uebayasi@jp.netbsd.org>
List: netbsd-bugs
Date: 01/15/2001 08:05:16
>Number:         11963
>Category:       pkg
>Synopsis:       apply the new "rc.d" scheme to FreeWnn's startup script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 15 08:05:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Masao Uebayashi
>Release:        1.5Q
>Organization:
SOUM Corporation
>Environment:
NetBSD takako 1.5Q NetBSD 1.5Q (TAKAKO) #0: Thu Jan 11 00:21:14 JST 2001     root@takako:/usr/src/sys/arch/i386/compile/TAKAKO i386
>Description:
I've made a "rc.d" script for FreeWnn.
some Makefile cleans up are also done.
>How-To-Repeat:

>Fix:
diff -Nru pkgsrc/misc/freewnn-common.orig/Makefile pkgsrc/misc/freewnn-common/Ma
kefile
--- pkgsrc/misc/freewnn-common.orig/Makefile    Tue Aug 22 06:01:32 2000
+++ pkgsrc/misc/freewnn-common/Makefile Tue Jan 16 00:29:04 2001
@@ -27,10 +27,7 @@
 SEDSCRIPT+=    -e 's|\([JCKT]\)\(WNNDICDIR = \).*|\1\2${DICT_DIR}/wnn/$$(\1WNNL
ANG)|'
 INSTALL_FILE=  ${WRKDIR}/INSTALL
 INSTALL_SRC=   ${FILESDIR}/INSTALL
-PLIST_TMP= ${PKGDIR}/PLIST
-PLIST_SRC= ${WRKDIR}/PLIST
 PLIST_SUBST=   DICT_DIR=${DICT_DIR} PREFIX=${PREFIX} WNN_LANG=${WNN_LANG}
-STARTUP_SCRIPT_SRC=${WRKDIR}/STARTUP
 .else
 MAKE_ENV+= "WNN_TARGET=LIBRARY"
 .endif
@@ -74,14 +71,8 @@
 post-build:
    @${SED} -e 's|$${WNNOWNER}|${WNNOWNER}|g'   \
        ${INSTALL_SRC} > ${INSTALL_FILE}
-   @${ECHO} '#!/bin/sh' > ${STARTUP_SCRIPT_SRC}
-   @${ECHO} 'freewnn=${JSERVER}' >> ${STARTUP_SCRIPT_SRC}
-   @${ECHO} 'if [ -f $$freewnn ]; then' >> ${STARTUP_SCRIPT_SRC}
-   @${ECHO} "    echo -n ' ${SCTITLE}'" >> ${STARTUP_SCRIPT_SRC}
-   @${ECHO} '     $$freewnn' >> ${STARTUP_SCRIPT_SRC}
-   @${ECHO} "fi" >> ${STARTUP_SCRIPT_SRC}
-   @${CP} ${PLIST_TMP} ${PLIST_SRC}
-   @${ECHO} ${STARTUP_SCRIPT} >> ${PLIST_SRC}
+   @${SED} -e 's|@PREFIX@|${PREFIX}|g' <${FILESDIR}/ja-freewnn.sh  \
+       >${WRKDIR}/ja-freewnn.sh
 
 pre-install:
    @${SETENV} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
@@ -89,7 +80,8 @@
 post-install:
    @${LN} -s ${DICT_DIR}/wnn/${WNN_LANG} \
        ${PREFIX}/share/wnn/${WNN_LANG}/dic
-   @${INSTALL_SCRIPT} ${STARTUP_SCRIPT_SRC} ${PREFIX}/${STARTUP_SCRIPT}
+   @${INSTALL_SCRIPT} ${WRKDIR}/ja-freewnn.sh \
+       ${PREFIX}/etc/rc.d/ja-freewnn.sh
 .endif
 
 .include "../../mk/bsd.pkg.mk"
diff -Nru pkgsrc/misc/freewnn-common.orig/files/ja-freewnn.sh pkgsrc/misc/freewn
n-common/files/ja-freewnn.sh
--- pkgsrc/misc/freewnn-common.orig/files/ja-freewnn.sh Thu Jan  1 09:00:00 1970
+++ pkgsrc/misc/freewnn-common/files/ja-freewnn.sh  Tue Jan 16 00:50:25 2001
@@ -0,0 +1,32 @@
+#! /bin/sh
+#
+# $NetBSD$
+#
+# PROVIDE: freewnn
+# REQUIRE: DAEMON
+
+name="freewnn"
+command_start="@PREFIX@/sbin/jserver"
+command_stop="@PREFIX@/sbin/wnnkill"
+pidfile=""
+
+cmd=${1:-start}
+
+case ${cmd} in
+start)
+    if [ -x ${command_start} ]; then
+        echo "Starting ${name}."
+        ${command_start} >/dev/null 2>&1
+    fi
+    ;;
+stop)
+    if [ -x ${command_stop} ]; then
+        echo "Stopping ${name}."
+        ${command_stop} >/dev/null 2>&1
+    fi
+    ;;
+*)
+    :
+    ;;
+esac
+exit 0
diff -Nru pkgsrc/japanese/freewnn-server.orig/Makefile pkgsrc/japanese/freewnn-s
erver/Makefile
--- pkgsrc/japanese/freewnn-server.orig/Makefile    Fri Sep  3 13:31:45 1999
+++ pkgsrc/japanese/freewnn-server/Makefile Tue Jan 16 00:27:48 2001
@@ -13,8 +13,4 @@
 FILESDIR=  ${MASTERDIR}/files
 PATCHDIR=  ${MASTERDIR}/patches
 
-STARTUP_SCRIPT=    etc/rc.d/ja-freewnn.sh
-JSERVER=   ${PREFIX}/sbin/jserver
-SCTITLE=   ja-FreeWnn
-
 .include "${MASTERDIR}/Makefile"
diff -Nru pkgsrc/japanese/freewnn-server.orig/pkg/PLIST pkgsrc/japanese/freewnn-
server/pkg/PLIST
--- pkgsrc/japanese/freewnn-server.orig/pkg/PLIST   Fri Sep  3 13:31:46 1999
+++ pkgsrc/japanese/freewnn-server/pkg/PLIST    Mon Jan 15 23:38:39 2001
@@ -65,5 +65,6 @@
 sbin/wnnkill
 sbin/wnnstat
 sbin/wnntouch
+etc/rc.d/ja-freewnn.sh
 @exec ln -s ${DICT_DIR}/wnn/ja_JP %D/share/wnn/ja_JP/dic
 @unexec rm %D/share/wnn/ja_JP/dic

>Release-Note:
>Audit-Trail:
>Unformatted: