The only reason for Wnn-data was the inability to do subpackage

dependencies. This no longer holds.
This commit is contained in:
espie 2001-03-28 15:13:03 +00:00
parent 673de31adf
commit 101c71c0dd
4 changed files with 153 additions and 11 deletions

View File

@ -1,18 +1,23 @@
# 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.32 2001/03/28 09:22:57 espie Exp $
# $OpenBSD: Makefile,v 1.33 2001/03/28 15:13:03 espie Exp $
COMMENT= "Japanese input method"
COMMENT-dict= "dictionaries for Japanese Wnn"
COMMENT-ko= "Korean input method"
COMMENT-kodict= "dictionaries for Korean Wnn"
COMMENT-zh= "Chinese input method"
COMMENT-zhdict= "dictionaries for Chinese Wnn"
COMMENT-data= "common files to all languages of Wnn"
COMMENT= Japanese input method
COMMENT-dict= dictionaries for Japanese Wnn
COMMENT-ko= Korean input method
COMMENT-kodict= dictionaries for Korean Wnn
COMMENT-xwnmo= X11 input method for Wnn
COMMENT-zh= Chinese input method
COMMENT-zhdict= dictionaries for Chinese Wnn
DISTNAME= Wnn4.2
MULTI_PACKAGES=-dict -zh -zhdict -ko -kodict -xwnmo
# If you are building this manually, you can override MULTI_PACKAGES
# on the command line, and thus avoid building all three languages
MULTI_PACKAGES=-dict -zh -zhdict -ko -kodict -xwnmo -data
NEED_VERSION= 1.377
NEED_VERSION= 1.361
PKGNAME= ja-Wnn-4.2
PKGNAME-dict= ja-Wnndict-4.2
@ -21,6 +26,7 @@ PKGNAME-zhdict= zh-Wnndict-4.2
PKGNAME-ko= ko-Wnn-4.2
PKGNAME-kodict= ko-Wnndict-4.2
PKGNAME-xwnmo= Wnn-xwnmo-4.2
PKGNAME-data= Wnn-data-4.2
SUBPACKAGE?=
@ -42,6 +48,8 @@ CATEGORIES= korean
PREFIX=${WNNDICDIR}
.elif ${SUBPACKAGE} == "-xwnmo"
CATEGORIES= japanese chinese korean
.elif ${SUBPACKAGE} == "-data"
CATEGORIES= japanese chinese korean
.else
CATEGORIES= japanese
.endif
@ -73,8 +81,10 @@ CDOC_FROM= ${WRKSRC}/cWnn
BUILD_DEPENDS= jgroff::japanese/groff
# Run depends ensure this does not turn into infinite recursion, since
# this is not needed before package build time.
# I'm grateful to having `real' cookies, which means this is possible.
RUN_DEPENDS= ${LOCALBASE}/lib/wnn/install-script::japanese/Wnn-data
.if ${SUBPACKAGE} != "-data"
RUN_DEPENDS= ${LOCALBASE}/lib/wnn/install-script::japanese/Wnn,-data
.endif
do-distpatch:
cd ${WRKDIR} && tar zxf ${FULLDISTDIR}/Wnn4.2.patch.tar.gz
@ -117,6 +127,7 @@ do-configure:
.endif
@cd ${WRKSRC}/config && ln -sf Project.tmpl X11.tmpl
# Xfree4 believes it can build html documentation, fat chance...
MAKE_FLAGS=IMAKE='imake -DBuildHtmlManPages=0 -DPorts' WNNOWNER_INDIRECT=wnn
FAKE_FLAGS=DESTDIR=${WRKINST} WNNOWNER_INDIRECT=bin
@ -141,5 +152,9 @@ post-install:
(cd ${PORT_CDOCDIR}; tar xf -))
@chown -R ${SHAREOWN}.${SHAREGRP} ${PORT_CDOCDIR}
.endif
${INSTALL_DATA_DIR} ${PREFIX}/lib/wnn
${INSTALL_DATA} ${WRKDIST}/Wnn/jd/sysV/cvt_key* ${PREFIX}/lib/wnn
${INSTALL_DATA} ${WRKDIST}/Wnn/jd/serverdefs ${PREFIX}/lib/wnn
${INSTALL_SCRIPT} ${FILESDIR}/install-script ${PREFIX}/lib/wnn
.include <bsd.port.mk>

103
japanese/Wnn/files/install-script Executable file
View File

@ -0,0 +1,103 @@
#!/bin/sh
# installation script for Japanese Wnn 4.2
DICDIR=/var/dict/Wnn
yesno() {
local question answer
question=$1
while :; do
read answer?"${question} (y/n) [y]"
case "${answer}" in
[Nn]*) return 1;;
[Yy]*) return 0;;
"") return 0;;
esac
echo "Please answer yes or no."
done
}
create_wnn() {
local uname begin gid
uname='wnn'
begin=128
while [ X`id -u $begin 2>/dev/null` == X$begin ]
do
begin=`expr $begin + 1`
done
echo "Creating user wnn ($begin)"
gid=`id -g bin`
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
if id -u wnn >/dev/null 2>/dev/null
then
echo "So, user wnn already exists !"
else
echo "You need a user named wnn"
if yesno "Would you like to create it automatically now"; then
create_wnn
else
echo "You still need to run /usr/local/lib/wnn/install-script"
echo "to finish Wnn installation later"
exit 0
fi
fi
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

View File

@ -0,0 +1,2 @@
This package only exists to provide common files
to the Japanese/Korean/Chinese Wnn.

View File

@ -0,0 +1,22 @@
@comment $OpenBSD: PLIST-data,v 1.1 2001/03/28 15:13:03 espie Exp $
lib/wnn/install-script
lib/wnn/cvt_key_empty
lib/wnn/cvt_key_tbl
lib/wnn/cvt_key_tbl.ST
lib/wnn/cvt_key_tbl.gm
lib/wnn/cvt_key_tbl.kt
lib/wnn/cvt_key_tbl.mv
lib/wnn/cvt_key_tbl.vt
lib/wnn/serverdefs
@comment Make those dirs in the common data part because of xwnmo
@exec mkdir -p %D/lib/wnn/ja_JP
@exec mkdir -p %D/lib/wnn/lt_LN
@exec mkdir -p %D/lib/wnn/zh_TW
@exec mkdir -p %D/lib/wnn/zh_CN
@exec mkdir -p %D/lib/wnn/ko_KR
@dirrm lib/wnn/ja_JP
@dirrm lib/wnn/lt_LN
@dirrm lib/wnn/zh_TW
@dirrm lib/wnn/zh_CN
@dirrm lib/wnn/ko_KR
@dirrm lib/wnn