Put dictionaries in /var/dict/Wnn to avoid confusion with Canna.
Let that be somewhat configurable. Fix all documentation to refer to the right location for dictionaries. Fix the install-script so that it can take care of all three languages at once. Let un-installation instructions be more helpful, explaining about usr data.
This commit is contained in:
parent
af7b47a7b5
commit
5ad172dd15
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
# installation script for Japanese Wnn 4.2
|
||||
|
||||
DICDIR=/var/dict/Wnn
|
||||
|
||||
yesno() {
|
||||
local question answer
|
||||
|
||||
@ -29,13 +31,35 @@ create_wnn() {
|
||||
chpass -a "wnn:*:${begin}:${gid}::::Wnn server:/root:/sbin/nologin" || exit 1
|
||||
}
|
||||
|
||||
for i in japanese chinese korean
|
||||
do
|
||||
case "$i" in
|
||||
japanese)
|
||||
name=ja
|
||||
base="$DICDIR/ja_JP"
|
||||
sys_dirs="$DICDIR/ja_JP/pubdic $DICDIR/ja_JP/wnncons"
|
||||
wnntouch=/usr/local/bin/wnntouch
|
||||
wnnserver=/usr/local/bin/jserver;;
|
||||
chinese)
|
||||
name=zh
|
||||
base="$DICDIR/zh_CN $DICDIR/zh_TW"
|
||||
sys_dirs="$DICDIR/zh_CN/sys $DICDIR/zh_TW/sys"
|
||||
wnntouch=/usr/local/bin/cwnntouch
|
||||
wnnserver=/usr/local/bin/cserver;;
|
||||
korean)
|
||||
name=ko
|
||||
base="$DICDIR/ko_KR"
|
||||
sys_dirs="$DICDIR/ko_KR/sys"
|
||||
wnntouch=/usr/local/bin/kwnntouch
|
||||
wnnserver=/usr/local/bin/kserver;;
|
||||
esac
|
||||
# no base package present yet, bail out
|
||||
[ -e $wnntouch ] || continue
|
||||
|
||||
|
||||
echo ""
|
||||
if id -u wnn >/dev/null 2>/dev/null
|
||||
then
|
||||
if id -u wnn >/dev/null 2>/dev/null
|
||||
then
|
||||
echo "So, user wnn already exists !"
|
||||
else
|
||||
else
|
||||
echo "You need a user named wnn"
|
||||
if yesno "Would you like to create it automatically now"; then
|
||||
create_wnn
|
||||
@ -44,47 +68,36 @@ else
|
||||
echo "to finish Wnn installation later"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
japanese)
|
||||
testdir="/var/dict/ja_JP"
|
||||
sys_dirs="/var/dict/ja_JP/pubdic var/dict/ja_JP/wnncons"
|
||||
usr_dirs=/var/dict/ja_JP/usr
|
||||
wnntouch=/usr/local/bin/wnntouch
|
||||
wnnserver=/usr/local/bin/jserver;;
|
||||
chinese)
|
||||
testdir="/var/dict/zh_CN"
|
||||
sys_dirs="/var/dict/zh_CN/sys var/dict/zh_TW/sys"
|
||||
usr_dirs="/var/dict/zh_CN/usr /var/dict/zh_TW/usr"
|
||||
wnntouch=/usr/local/bin/cwnntouch
|
||||
wnnserver=/usr/local/bin/cserver;;
|
||||
korean)
|
||||
testdir="/var/dict/ko_KR"
|
||||
sys_dirs="/var/dict/ko_KR/sys"
|
||||
usr_dirs=/var/dict/ko_KR/usr
|
||||
wnntouch=/usr/local/bin/kwnntouch
|
||||
wnnserver=/usr/local/bin/kserver;;
|
||||
esac
|
||||
|
||||
# installation not yet complete, bail out
|
||||
[ -e $wnntouch ] || exit 0
|
||||
|
||||
chown wnn $wnnserver
|
||||
chmod u+s $wnnserver
|
||||
|
||||
# base directory not yet present, bail out
|
||||
|
||||
[ -d $testdir ] || exit 0
|
||||
|
||||
for dir in $sys_dirs; do
|
||||
$wnntouch $dir/*
|
||||
done
|
||||
|
||||
for dir in $usr_dirs; do
|
||||
if [ ! -d $dir ]; then
|
||||
mkdir -p $dir
|
||||
fi
|
||||
chown wnn $dir
|
||||
|
||||
chown wnn $wnnserver
|
||||
chmod u+s $wnnserver
|
||||
|
||||
# base directory not yet present, bail out
|
||||
|
||||
for dir in $base; do
|
||||
if [ -d $dir ]; then
|
||||
if [ `ls -ld $dir |awk '{print $3}'` == wnn ]; then
|
||||
# already installed
|
||||
continue 2
|
||||
else
|
||||
chown -R wnn $dir
|
||||
fi
|
||||
else
|
||||
echo "For a complete server, you need $name-Wnn-dict-4.2 as well"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
|
||||
for dir in $sys_dirs; do
|
||||
$wnntouch $dir/*
|
||||
done
|
||||
|
||||
for dir in $base; do
|
||||
if [ ! -d $dir/usr ]; then
|
||||
mkdir -p $dir/usr
|
||||
fi
|
||||
chown wnn $dir/usr
|
||||
chmod u+w $dir/usr
|
||||
done
|
||||
done
|
||||
chmod -R u+w $dir
|
||||
|
@ -1,30 +1,34 @@
|
||||
# From FreeBSD: Satoshi Taoka <taoka@infonets.hiroshima-u.ac.jp>
|
||||
#
|
||||
# $FreeBSD: Makefile,v 1.19 1997/09/23 02:17:58 max Exp $
|
||||
# $OpenBSD: Makefile,v 1.24 2000/04/21 02:10:53 espie Exp $
|
||||
# $OpenBSD: Makefile,v 1.25 2000/04/21 15:09:51 espie Exp $
|
||||
|
||||
DISTNAME= Wnn4.2
|
||||
|
||||
MULTI_PACKAGES=-dict -zh -zhdict -ko -kodict
|
||||
NEED_VERSION= 1.270
|
||||
SUBPACKAGE?=
|
||||
|
||||
WNNDICDIR=/var/dict/Wnn
|
||||
WNNBASE=${PREFIX}
|
||||
|
||||
.if ${SUBPACKAGE} == "-dict"
|
||||
CATEGORIES= japanese
|
||||
PREFIX=/var/dict
|
||||
PREFIX=${WNNDICDIR}
|
||||
PKGNAME= ja-Wnn-dict-4.2
|
||||
.elif ${SUBPACKAGE} == "-zh"
|
||||
CATEGORIES= chinese
|
||||
PKGNAME= zh-Wnn-4.2
|
||||
.elif ${SUBPACKAGE} == "-zhdict"
|
||||
CATEGORIES= chinese
|
||||
PREFIX=/var/dict
|
||||
PREFIX=${WNNDICDIR}
|
||||
PKGNAME= zh-Wnn-dict-4.2
|
||||
.elif ${SUBPACKAGE} == "-ko"
|
||||
CATEGORIES= korean
|
||||
PKGNAME= ko-Wnn-4.2
|
||||
.elif ${SUBPACKAGE} == "-kodict"
|
||||
CATEGORIES= korean
|
||||
PREFIX=/var/dict
|
||||
PREFIX=${WNNDICDIR}
|
||||
PKGNAME= ko-Wnn-dict-4.2
|
||||
.else
|
||||
CATEGORIES= japanese
|
||||
@ -65,14 +69,25 @@ do-distpatch:
|
||||
cd ${WRKDIR} && tar zxf ${FULLDISTDIR}/Wnn4.2.patch.tar.gz
|
||||
cd ${WRKSRC} && patch ${PATCH_DIST_ARGS} < ${WRKDIR}/Wnn4.2.patch
|
||||
|
||||
# do those as post-patch, because of the $Id: Makefile,v 1.24 2000/04/21 02:10:53 espie Exp $
|
||||
SRCDOCDIRS=Wnn/man Wnn/manual Wnn/manual.en cWnn/man cWnn/manual cWnn/manual.en
|
||||
|
||||
# do those as post-patch, because of the $Id
|
||||
post-patch:
|
||||
@cd ${WRKDIST}; \
|
||||
for file in Wnn/jd/jserverrc cWnn/cd/cserverrc kWnn/kd/kserverrc; do\
|
||||
perl -pi.bak -e 's,\@LIBDIR/\@LANG/dic,/var/dict/\@LANG,' $$file; done
|
||||
perl -pi.bak -e 's,\@LIBDIR/\@LANG/dic,${WNNDICDIR}/\@LANG,;' $$file; done
|
||||
# Commands are installed directly under /usr/local/bin and dictionaries in /var/dict
|
||||
@{ for dir in ${SRCDOCDIRS}; do \
|
||||
find ${WRKSRC}/$$dir -type f; done; } \
|
||||
| xargs perl -pi.bok -e \
|
||||
's,/usr/local/bin/Wnn4/,${PREFIX}/bin/,g; s,/usr/local/lib/wnn/dic,${WNNDICDIR},g;'
|
||||
@{ for dir in ${SRCDOCDIRS}; do \
|
||||
find ${WRKSRC}/$$dir -type f -name \*.bok; done; } | xargs rm
|
||||
|
||||
do-configure:
|
||||
@echo "#define BuildWnn YES" >${CONFIG_FILE}
|
||||
@echo " WNNDICDIR = ${WNNDICDIR}" >${CONFIG_FILE}
|
||||
@echo " WNNBASEDIR = ${PREFIX}" >>${CONFIG_FILE}
|
||||
@echo "#define BuildWnn YES" >>${CONFIG_FILE}
|
||||
.if ${MULTI_PACKAGES:M-zh}
|
||||
@echo "#define BuildCWnn YES" >>${CONFIG_FILE}
|
||||
.else
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
$OpenBSD: patch-config_Project_tmpl,v 1.5 2000/04/21 15:09:52 espie Exp $
|
||||
--- config/Project.tmpl.orig Mon Aug 29 10:40:17 1994
|
||||
+++ config/Project.tmpl Fri Apr 21 04:05:16 2000
|
||||
+++ config/Project.tmpl Fri Apr 21 16:51:46 2000
|
||||
@@ -14,6 +14,20 @@ XCOMM $XConsortium: Project.tmpl,v 1.242
|
||||
* *
|
||||
***************************************************************************/
|
||||
@ -56,7 +56,7 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
#ifndef BuildWnn
|
||||
#define BuildWnn YES
|
||||
#endif
|
||||
@@ -1230,12 +1243,13 @@ install:: list @@\
|
||||
@@ -1230,14 +1243,14 @@ install:: list @@\
|
||||
* as YES. Default is that dictionary isn't installed if it exist already.
|
||||
*/
|
||||
|
||||
@ -67,11 +67,14 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
#else
|
||||
IMTOP = $(CONTRIBSRC)/programs/Xsi
|
||||
#endif
|
||||
+ WNNDICDIR = /var/dict
|
||||
WNNWNNDIR = /usr/local/lib/wnn
|
||||
WNNBINDIR = /usr/local/bin
|
||||
- WNNWNNDIR = /usr/local/lib/wnn
|
||||
- WNNBINDIR = /usr/local/bin
|
||||
+ WNNWNNDIR = $(WNNBASEDIR)/lib/wnn
|
||||
+ WNNBINDIR = $(WNNBASEDIR)/bin
|
||||
WNNINCDIR = $(INCROOT)
|
||||
@@ -1248,9 +1262,9 @@ install:: list @@\
|
||||
WNNLIBDIR = $(USRLIBDIR)
|
||||
WNNTERM_LIB = termLibrary
|
||||
@@ -1248,9 +1261,9 @@ install:: list @@\
|
||||
WNNTOP = $(IMTOP)/Wnn
|
||||
JWNNLANG = ja_JP
|
||||
JWNNWNNDIR = $(WNNWNNDIR)/$(JWNNLANG)
|
||||
@ -83,7 +86,7 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
JWNNPUBDICDIR = $(JWNNDICDIR)/pubdic
|
||||
JWNNWNNCONSDICDIR = $(JWNNDICDIR)/wnncons
|
||||
JWNNFZKSRCDIR = $(JWNNDICDIR)/src
|
||||
@@ -1278,8 +1292,8 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
@@ -1278,8 +1291,8 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
CWNNLANG = zh_CN
|
||||
CWNNWNNDIR = $(WNNWNNDIR)/$(CWNNLANG)
|
||||
CWNNINCDIR = $(WNNINCDIR)/cwnn
|
||||
@ -94,7 +97,7 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
CWNNSYSDICDIR = $(CWNNDICDIR)/sys
|
||||
CWNNCDSRC = $(CWNNTOP)/cd
|
||||
CWNNCDICSRC = $(CWNNTOP)/cdic
|
||||
@@ -1301,8 +1315,8 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
@@ -1301,8 +1314,8 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
KWNNLANG = ko_KR
|
||||
KWNNWNNDIR = $(WNNWNNDIR)/$(KWNNLANG)
|
||||
KWNNINCDIR = $(WNNINCDIR)/kwnn
|
||||
@ -105,7 +108,7 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
KWNNSYSDICDIR = $(KWNNDICDIR)/sys
|
||||
KWNNKDSRC = $(KWNNTOP)/kd
|
||||
KWNNKDICSRC = $(KWNNTOP)/kdic
|
||||
@@ -1322,7 +1336,7 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
@@ -1322,7 +1335,7 @@ WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic
|
||||
|
||||
TWNNLANG = zh_TW
|
||||
TWNNWNNDIR = $(WNNWNNDIR)/$(TWNNLANG)
|
||||
@ -114,7 +117,7 @@ $OpenBSD: patch-config_Project_tmpl,v 1.4 2000/04/21 02:10:54 espie Exp $
|
||||
TWNNSYSDICDIR = $(TWNNDICDIR)/sys
|
||||
TWNNTDSRC = $(CWNNTOP)/td
|
||||
TWNNTDICSRC = $(CWNNTOP)/tdic
|
||||
@@ -1363,3 +1377,44 @@ XWNMOROMKANMSRC = $(XWNMOTOP)/romkan_m
|
||||
@@ -1363,3 +1376,44 @@ XWNMOROMKANMSRC = $(XWNMOTOP)/romkan_m
|
||||
#else
|
||||
IMAKE_CMD = $(IMAKE) -I$(IMIRULESRC) -I$(IRULESRC) $(IMAKE_DEFINES)
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.9 2000/04/21 02:01:52 espie Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.10 2000/04/21 15:09:52 espie Exp $
|
||||
bin/atod
|
||||
bin/atof
|
||||
bin/dtoa
|
||||
@ -492,7 +492,7 @@ share/doc/ja-Wnn/manual/6.jutil/wnntouch
|
||||
share/doc/ja-Wnn/manual/7.Protocol/KKTP
|
||||
share/doc/ja-Wnn/manual/intro
|
||||
share/doc/ja-Wnn/manual/v3tov4/v3tov4
|
||||
@exec /usr/local/lib/wnn/install-script japanese
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@dirrm share/doc/ja-Wnn/manual/v3tov4
|
||||
@dirrm share/doc/ja-Wnn/manual/7.Protocol
|
||||
@dirrm share/doc/ja-Wnn/manual/6.jutil
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-dict,v 1.2 2000/04/21 00:45:30 espie Exp $
|
||||
@comment $OpenBSD: PLIST-dict,v 1.3 2000/04/21 15:09:52 espie Exp $
|
||||
@comment no checksum
|
||||
ja_JP/pubdic/bio.dic
|
||||
@comment no checksum
|
||||
@ -36,5 +36,8 @@ ja_JP/src/fzk.shuutan
|
||||
ja_JP/wnncons/tankan2.dic
|
||||
@comment no checksum
|
||||
ja_JP/wnncons/tankan3.dic
|
||||
@exec /usr/local/lib/wnn/install-script japanese
|
||||
@unexec echo "Finish removing %D/ja_JP manually"
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@dirrm ja_JP/pubdic
|
||||
@dirrm ja_JP/wnncons
|
||||
@dirrm ja_JP/src
|
||||
@unexec echo "usr info may exist: finish removing %D/ja_JP manually"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-ko,v 1.2 2000/04/21 02:01:52 espie Exp $
|
||||
@comment $OpenBSD: PLIST-ko,v 1.3 2000/04/21 15:09:52 espie Exp $
|
||||
bin/katod
|
||||
bin/katof
|
||||
bin/kdtoa
|
||||
@ -109,7 +109,7 @@ share/doc/zh-cWnn/manual/contents
|
||||
share/doc/zh-cWnn/manual/glossary
|
||||
share/doc/zh-cWnn/manual/index
|
||||
share/doc/zh-cWnn/manual/preface
|
||||
@exec /usr/local/lib/wnn/install-script korean
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@dirrm share/doc/zh-cWnn/manual.en
|
||||
@dirrm share/doc/zh-cWnn/manual
|
||||
@dirrm share/doc/zh-cWnn
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-kodict,v 1.2 2000/04/21 02:01:52 espie Exp $
|
||||
@comment $OpenBSD: PLIST-kodict,v 1.3 2000/04/21 15:09:52 espie Exp $
|
||||
@comment no checksum
|
||||
ko_KR/sys/full.fzk
|
||||
@comment no checksum
|
||||
@ -6,6 +6,5 @@ ko_KR/sys/hword.dic
|
||||
@comment no checksum
|
||||
ko_KR/sys/single.dic
|
||||
@dirrm ko_KR/sys
|
||||
@dirrm ko_KR
|
||||
@exec /usr/local/lib/wnn/install-script korean
|
||||
@unexec echo "Finish removing %D/ko_KR manually"
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@unexec echo "usr info may exist: finish removing %D/ko_KR manually"
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-zh,v 1.2 2000/04/21 02:01:52 espie Exp $
|
||||
@comment $OpenBSD: PLIST-zh,v 1.3 2000/04/21 15:09:52 espie Exp $
|
||||
bin/catod
|
||||
bin/catof
|
||||
bin/cdtoa
|
||||
@ -195,7 +195,7 @@ share/doc/zh-cWnn/manual/contents
|
||||
share/doc/zh-cWnn/manual/glossary
|
||||
share/doc/zh-cWnn/manual/index
|
||||
share/doc/zh-cWnn/manual/preface
|
||||
@exec /usr/local/lib/wnn/install-script chinese
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@dirrm share/doc/zh-cWnn/manual.en
|
||||
@dirrm share/doc/zh-cWnn/manual
|
||||
@dirrm share/doc/zh-cWnn
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-zhdict,v 1.2 2000/04/21 02:10:54 espie Exp $
|
||||
@comment $OpenBSD: PLIST-zhdict,v 1.3 2000/04/21 15:09:54 espie Exp $
|
||||
@comment no checksum
|
||||
zh_CN/sys/QianMa.dic
|
||||
@comment no checksum
|
||||
@ -25,9 +25,7 @@ zh_TW/sys/cns_wd.dic
|
||||
zh_TW/sys/full.con
|
||||
@comment no checksum
|
||||
zh_TW/sys/full.conR
|
||||
@exec /usr/local/lib/wnn/install-script chinese
|
||||
@unexec echo "Finish removing %D/zh_TW manually"
|
||||
@exec /usr/local/lib/wnn/install-script
|
||||
@unexec echo "usr info may exist: finish removing %D/zh_CN & %D/zh_TW manually"
|
||||
@dirrm zh_TW/sys
|
||||
@dirrm zh_TW
|
||||
@dirrm zh_CN/sys
|
||||
@dirrm zh_CN
|
||||
|
Loading…
Reference in New Issue
Block a user