summaryrefslogtreecommitdiff
path: root/inputmethod/skkserv
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2002-05-31 12:59:58 +0000
committerseb <seb@pkgsrc.org>2002-05-31 12:59:58 +0000
commitccf31e5072384b7cbb450cbbfd536c92b8166d20 (patch)
tree03d870fa2589c8907e9d42df7cdac8c7fc89db9a /inputmethod/skkserv
parent8983cb50fc6af95456d1b8f77f632e500a0e553b (diff)
downloadpkgsrc-ccf31e5072384b7cbb450cbbfd536c92b8166d20.tar.gz
Reimport of package skkserv from japanese/skkserv into inputmethod/skkserv.
This is part of the japanese category retirement. CATEGORIES adjusted.
Diffstat (limited to 'inputmethod/skkserv')
-rw-r--r--inputmethod/skkserv/DESCR6
-rw-r--r--inputmethod/skkserv/INSTALL13
-rw-r--r--inputmethod/skkserv/MESSAGE6
-rw-r--r--inputmethod/skkserv/Makefile63
-rw-r--r--inputmethod/skkserv/PLIST11
-rw-r--r--inputmethod/skkserv/distinfo16
-rw-r--r--inputmethod/skkserv/files/skkserv.sh26
-rw-r--r--inputmethod/skkserv/patches/patch-aa21
-rw-r--r--inputmethod/skkserv/patches/patch-ab13
-rw-r--r--inputmethod/skkserv/patches/patch-ac15
-rw-r--r--inputmethod/skkserv/patches/patch-ad13
-rw-r--r--inputmethod/skkserv/patches/patch-ae14
-rw-r--r--inputmethod/skkserv/patches/patch-af282
-rw-r--r--inputmethod/skkserv/patches/patch-ag142
-rw-r--r--inputmethod/skkserv/patches/patch-ah13
-rw-r--r--inputmethod/skkserv/patches/patch-bsearch123
-rw-r--r--inputmethod/skkserv/patches/patch-jisyo112
17 files changed, 889 insertions, 0 deletions
diff --git a/inputmethod/skkserv/DESCR b/inputmethod/skkserv/DESCR
new file mode 100644
index 00000000000..7694fcc0c93
--- /dev/null
+++ b/inputmethod/skkserv/DESCR
@@ -0,0 +1,6 @@
+ skkserv is a dictionary server for SKK (Simple Kana to
+Kanji conversion) programs, including skk.el (Emacs Lisp),
+skkfep (tty-based frontend), and skkinput (X11 frontend).
+
+ This package also contains manipulation tools of
+SKK-format dictionaries.
diff --git a/inputmethod/skkserv/INSTALL b/inputmethod/skkserv/INSTALL
new file mode 100644
index 00000000000..5adf8d61b41
--- /dev/null
+++ b/inputmethod/skkserv/INSTALL
@@ -0,0 +1,13 @@
+#! /bin/sh
+# $NetBSD: INSTALL,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+case "$2" in
+POST-INSTALL)
+ if egrep '^skkserv[ ]' /etc/services >/dev/null; then
+ :
+ else
+ echo '
+skkserv 1178/tcp # SKK server' >>/etc/services
+ fi
+ ;;
+esac
diff --git a/inputmethod/skkserv/MESSAGE b/inputmethod/skkserv/MESSAGE
new file mode 100644
index 00000000000..0d8a9150e11
--- /dev/null
+++ b/inputmethod/skkserv/MESSAGE
@@ -0,0 +1,6 @@
+======================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+Please add ${PREFIX}/etc/rc.d/skkserv to /etc/rc.local.
+
+======================================================================
diff --git a/inputmethod/skkserv/Makefile b/inputmethod/skkserv/Makefile
new file mode 100644
index 00000000000..555d1d77e5a
--- /dev/null
+++ b/inputmethod/skkserv/Makefile
@@ -0,0 +1,63 @@
+# $NetBSD: Makefile,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+DISTNAME= skk9.6
+PKGNAME= skkserv-3.9.4
+PKGREVISION= 1
+WRKSRC= ${WRKDIR}/skk-9.6
+CATEGORIES= japanese inputmethod
+MASTER_SITES= ftp://skk.kuis.kyoto-u.ac.jp/skk/9.6/
+
+PATCHFILES= SKK-JISYO.L.diff.gz
+PATCH_SITES= http://www.ht-net21.ne.jp/%7Enaoki-w/skk/
+PATCH_DIST_ARGS= -d ${WRKSRC}/jisyo --forward --quiet
+
+MAINTAINER= packages@netbsd.org
+HOMEPAGE= http://skk.kuis.kyoto-u.ac.jp/
+COMMENT= Dictionary server for Simple Kana-Kanji conversion programs
+
+BUILD_DEFS+= USE_INET6
+
+DIST_SUBDIR= skk
+
+GNU_CONFIGURE= YES
+INSTALL_FILE= ${WRKDIR}/INSTALL
+
+.include "../../mk/bsd.prefs.mk"
+
+.if (${OPSYS} == "SunOS")
+.if exists(/usr/ccs)
+SKKSERV_UID?= 60002 # noaccess
+SKKSERV_GID?= 60002 # noaccess
+.else
+SKKSERV_UID?= 65534 # nobody
+SKKSERV_GID?= 65534 # nogroup
+.endif
+.endif
+SKKSERV_UID?= 32767 # nobody
+SKKSERV_GID?= 32766 # nogroup
+MAKE_ENV= SKKUID=${SKKSERV_UID} SKKGID=${SKKSERV_GID}
+
+# tmp for building dictionary. ~16MB required. mfs would be much faster.
+TMPDIR?= ${WRKDIR}
+
+post-build:
+ ${SED} -e 's#@PREFIX@#${PREFIX}#g' <${FILESDIR}/skkserv.sh \
+ >${WRKDIR}/skkserv.sh
+ ${SED} -e 's#@PREFIX@#${PREFIX}#g' <${PKGDIR}/INSTALL >${INSTALL_FILE}
+ :
+ : Merging dictionaries....
+ :
+ ${WRKSRC}/jisyo-tools/skkdic-expr -d ${TMPDIR} \
+ ${WRKSRC}/jisyo/SKK-JISYO.L + ${WRKSRC}/jisyo/SKK-JISYO.JIS2 | \
+ ${WRKSRC}/jisyo-tools/skkdic-sort >${WRKDIR}/SKK-JISYO.L
+
+post-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/skkserv.sh ${PREFIX}/etc/rc.d/skkserv
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/skk
+ ${INSTALL_DATA} ${WRKDIR}/SKK-JISYO.L ${PREFIX}/share/skk/SKK-JISYO.L
+ ${INSTALL_DATA} ${WRKSRC}/skkserv/README ${PREFIX}/share/skk/README.skkserv
+ ${INSTALL_DATA} ${WRKSRC}/jisyo-tools/README.1st ${PREFIX}/share/skk/README.1st.jisyo-tools
+ ${INSTALL_DATA} ${WRKSRC}/jisyo-tools/README ${PREFIX}/share/skk/README.jisyo-tools
+ ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/inputmethod/skkserv/PLIST b/inputmethod/skkserv/PLIST
new file mode 100644
index 00000000000..28bfc19af37
--- /dev/null
+++ b/inputmethod/skkserv/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+bin/skkdic-expr
+bin/skkdic-sort
+bin/skkdic-count
+etc/rc.d/skkserv
+libexec/skkserv
+share/skk/SKK-JISYO.L
+share/skk/README.skkserv
+share/skk/README.1st.jisyo-tools
+share/skk/README.jisyo-tools
+@dirrm share/skk
diff --git a/inputmethod/skkserv/distinfo b/inputmethod/skkserv/distinfo
new file mode 100644
index 00000000000..00a17b1e8df
--- /dev/null
+++ b/inputmethod/skkserv/distinfo
@@ -0,0 +1,16 @@
+$NetBSD: distinfo,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+SHA1 (skk/skk9.6.tar.gz) = f462b4586dff6e36bfe331a526e054c3f6c3aad9
+Size (skk/skk9.6.tar.gz) = 2407653 bytes
+SHA1 (skk/SKK-JISYO.L.diff.gz) = aecf9a7aa8607b9e9a4a3c7e74268ffb09c775ad
+Size (skk/SKK-JISYO.L.diff.gz) = 15533 bytes
+SHA1 (patch-aa) = d9ee708fe5dcf36258256bdb4ba4c8d7e16905da
+SHA1 (patch-ab) = 5103484679c5d82a8d79460cc24e8857fc89460a
+SHA1 (patch-ac) = 3a1818c3bb453b69eb23154ed0daa6909275774b
+SHA1 (patch-ad) = 27abe12b627e8e5c5de0a78fab3a5f4551f3c0f7
+SHA1 (patch-ae) = 356b3bab93365bb769a340b99979161f07f60de4
+SHA1 (patch-af) = 0ee1792a36a220096048801346c466c9e3ec2736
+SHA1 (patch-ag) = f60d3e410cfc1c438827fa498e5fa4bc4dc3ec46
+SHA1 (patch-ah) = 414fc705a685f0276ae3a66d2f2546e1e7767495
+SHA1 (patch-bsearch) = d753fe29c2d0301a9e7bbf8c2d1f624447761cad
+SHA1 (patch-jisyo) = 0711c55fb8df69648bd182de68ea6a69d42ac9af
diff --git a/inputmethod/skkserv/files/skkserv.sh b/inputmethod/skkserv/files/skkserv.sh
new file mode 100644
index 00000000000..cbc95674cfd
--- /dev/null
+++ b/inputmethod/skkserv/files/skkserv.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $NetBSD: skkserv.sh,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+#
+# PROVIDE: skkserv
+# REQUIRE: DAEMON
+
+name="skkserv"
+command="@PREFIX@/libexec/skkserv"
+pidfile=""
+
+cmd=${1:-start}
+
+case ${cmd} in
+start)
+ if [ -x ${command} ]; then
+ echo "Starting ${name}."
+ ${command} > /dev/null 2>&1
+ fi
+ ;;
+*)
+ if [ -x ${command} ]; then
+ ${command} ${cmd} > /dev/null 2>&1
+ fi
+ ;;
+esac
diff --git a/inputmethod/skkserv/patches/patch-aa b/inputmethod/skkserv/patches/patch-aa
new file mode 100644
index 00000000000..07c5161730c
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-aa
@@ -0,0 +1,21 @@
+$NetBSD: patch-aa,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- Makefile.in.orig Mon Feb 3 18:21:39 1997
++++ Makefile.in Tue Dec 21 20:03:09 1999
+@@ -33,7 +33,7 @@
+ JISYO = @JISYO@
+ JISYODIR = $(datadir)/skk
+
+-SUBDIRS = lisp skkserv jisyo-tools doc etc
++SUBDIRS = skkserv jisyo-tools
+
+ MDEFINES = CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
+ EMACS='$(EMACS)' JISYO='$(JISYO)' JISYODIR='$(JISYODIR)' \
+@@ -50,7 +50,6 @@
+ echo making $@ in $$subdir; \
+ (cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; \
+ done
+- $(INSTALL_DATA) jisyo/$(JISYO) $(JISYODIR)/$(JISYO)
+
+ clean:
+ cd lisp; $(MAKE) clean
diff --git a/inputmethod/skkserv/patches/patch-ab b/inputmethod/skkserv/patches/patch-ab
new file mode 100644
index 00000000000..d3e44ea1829
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- configure.in.orig Mon Feb 3 17:02:01 1997
++++ configure.in Tue Dec 21 15:46:54 1999
+@@ -18,7 +18,7 @@
+ AC_PROG_GCC_TRADITIONAL
+ AC_FUNC_SETPGRP
+ AC_TYPE_SIGNAL
+-AC_CHECK_FUNCS(bzero tiocnotty getdtablesize)
++AC_CHECK_FUNCS(bzero setsid getdtablesize)
+
+ AC_CHECK_FUNC(dbm_open, , [DBMLIB="-ldbm"])
+
diff --git a/inputmethod/skkserv/patches/patch-ac b/inputmethod/skkserv/patches/patch-ac
new file mode 100644
index 00000000000..37f8526a3c4
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ac
@@ -0,0 +1,15 @@
+$NetBSD: patch-ac,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- config.h.in.orig Fri Jan 17 20:27:10 1997
++++ config.h.in Tue Dec 21 15:52:49 1999
+@@ -15,8 +15,8 @@
+ /* Define if you have the getdtablesize function. */
+ #undef HAVE_GETDTABLESIZE
+
+-/* Define if you have the tiocnotty function. */
+-#undef HAVE_TIOCNOTTY
++/* Define if you have the setsid function. */
++#undef HAVE_SETSID
+
+ /* Define if you have the <fcntl.h> header file. */
+ #undef HAVE_FCNTL_H
diff --git a/inputmethod/skkserv/patches/patch-ad b/inputmethod/skkserv/patches/patch-ad
new file mode 100644
index 00000000000..a2bb2976249
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- configure.orig Fri Feb 7 14:00:43 1997
++++ configure Tue Dec 21 15:46:55 1999
+@@ -1191,7 +1191,7 @@
+ EOF
+
+
+-for ac_func in bzero tiocnotty getdtablesize
++for ac_func in bzero setsid getdtablesize
+ do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+ echo "configure:1198: checking for $ac_func" >&5
diff --git a/inputmethod/skkserv/patches/patch-ae b/inputmethod/skkserv/patches/patch-ae
new file mode 100644
index 00000000000..8963184631c
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ae
@@ -0,0 +1,14 @@
+$NetBSD: patch-ae,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- skkserv/Makefile.in.orig Fri Feb 7 11:05:23 1997
++++ skkserv/Makefile.in Tue Dec 21 07:41:57 1999
+@@ -28,7 +28,8 @@
+ SERVERDIR = @libexecdir@
+
+ DEFS = -I$(srcdir) -I$(top_srcdir) $(CFLAGS) @DEFS@ @PRIVATE@ \
+- -DDEFAULT_JISYO=\"$(JISYODIR)/$(JISYO)\"
++ -DDEFAULT_JISYO=\"$(JISYODIR)/$(JISYO)\" \
++ -DSKKSERV_UID=${SKKUID} -DSKKSERV_GID=${SKKGID}
+
+ all: skkserv
+
diff --git a/inputmethod/skkserv/patches/patch-af b/inputmethod/skkserv/patches/patch-af
new file mode 100644
index 00000000000..2699f3f9c83
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-af
@@ -0,0 +1,282 @@
+$NetBSD: patch-af,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- skkserv/skkserv.c.orig Tue Jan 21 04:16:36 1997
++++ skkserv/skkserv.c Mon Nov 6 00:12:57 2000
+@@ -100,14 +100,16 @@
+ #define SERVER_NOT_FOUND "4"
+ #define SERVER_FULL "9"
+
++#define warn(m) \
++ {if (debug) fprintf(errout, "%s: %s\n", pgmnm, m);}
+ #define err(m) \
+- {if (debug) fprintf(errout, "%s: %s\n", pgmnm, m); exit(1);}
++ {warn(m); exit(1);}
+
+ /*
+ * Global Variables
+ */
+
+-char pgmver[] = "3.9.4 "; /* version number */
++char pgmver[] = "3.9.4nb1 "; /* version number */
+
+ char *pgmnm; /* program name */
+ char *jname; /* name of shared dictionary */
+@@ -121,6 +123,9 @@
+ int jtab1[KANAMOJI]; /* index-table by 1st letter (1st part)*/
+ int jtab2[KANAMOJI]; /* index-table by 1st letter (2nd part)*/
+ int initsock; /* socket for waiting requests */
++#ifdef PF_INET6
++int initsock6; /* IPv6 socket for waiting requests */
++#endif
+ int clientsock[MAXCLNT]; /* socket for each client */
+ int nclients; /* max index for active clients */
+
+@@ -130,8 +135,18 @@
+ int parg;
+ int setjisho = 0;
+ int ctlterm; /* fildes for control terminal */
+- void reread();
++ RETSIGTYPE req_reread();
++
++#ifdef SKKSERV_UID
++ gid_t gid = SKKSERV_GID;
+
++ /* revoke privilege if any */
++ if (geteuid() == 0) {
++ setgroups(1, &gid);
++ setgid(SKKSERV_GID);
++ setuid(SKKSERV_UID);
++ }
++#endif
+ pgmnm = argv[0];
+ debug = 0;
+ errout = stderr;
+@@ -200,7 +215,10 @@
+ fclose(stderr);
+
+ /* detach child process from control terminal */
+-#ifdef HAVE_TIOCNOTTY
++#ifdef HAVE_SETSID
++ setsid();
++#else
++#ifdef TIOCNOTTY
+ if ((ctlterm = open("/dev/tty", 2)) >= 0) {
+ ioctl(ctlterm, TIOCNOTTY, 0);
+ close(ctlterm);
+@@ -215,6 +233,7 @@
+ signal(SIGHUP, SIG_IGN);
+ if (fork() != 0) exit(0);
+ #endif
++#endif
+ } else { /* debug mode */
+ fprintf(errout, "SKK-JISYO is %s\n", jname);
+ fflush(errout);
+@@ -222,7 +241,7 @@
+ if (errout != stderr) fclose(stderr);
+ }
+
+- signal(SIGINT, reread);
++ signal(SIGINT, req_reread);
+ /* 1993/6/5 by kam, re-read dictionary by "INT" signal */
+
+ nclients = 0;
+@@ -244,8 +263,11 @@
+ mksock()
+ {
+ struct sockaddr_in sin;
++#ifdef PF_INET6
++ struct sockaddr_in6 sin6;
++#endif
+ struct servent *sp;
+- int optbuf = 1; /* enable socket REUSEADDR */
++ int optbuf; /* enable socket REUSEADDR */
+
+ bzero((char*)&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+@@ -262,16 +284,54 @@
+ sin.sin_port = htons(portnum);
+
+ if ((initsock = socket(PF_INET, SOCK_STREAM, 0)) < 0)
+- err("socket error; socket cannot be created");
+- if (setsockopt(initsock, SOL_SOCKET, SO_REUSEADDR,
++ warn("socket error; socket cannot be created");
++#ifdef PF_INET6
++ bzero((char*)&sin6, sizeof(sin6));
++ sin6.sin6_family = AF_INET6;
++ /* sin6.sin6_addr.s6_addr = IN6ADDR_ANY_INIT; ... all-zero pattern */
++ sin6.sin6_port = htons(portnum);
++ if ((initsock6 = socket(PF_INET6, SOCK_STREAM, 0)) < 0)
++ warn("socket error; IPv6 socket cannot be created");
++#endif
++ optbuf = 1;
++ if (initsock >= 0 && setsockopt(initsock, SOL_SOCKET, SO_REUSEADDR,
++ &optbuf, sizeof(optbuf)) < 0)
++ warn("socket error; cannot set socket option");
++#ifdef PF_INET6
++ optbuf = 1;
++ if (initsock6 >= 0 && setsockopt(initsock6, SOL_SOCKET, SO_REUSEADDR,
+ &optbuf, sizeof(optbuf)) < 0)
+- err("socket error; cannot set socket option");
+- if (bind(initsock, (struct sockaddr *)&sin, sizeof(sin))< 0)
+- err("bind error; the socket is already used");
+- if (listen(initsock, MAXQUE) < 0)
++ warn("socket error; cannot set socket option");
++#endif
++ if (initsock >= 0 && bind(initsock, (struct sockaddr *)&sin, sizeof(sin))< 0) {
++ warn("bind error; the socket is already used");
++ close(initsock);
++ initsock = -1;
++ }
++#ifdef PF_INET6
++ if (initsock6 >= 0 && bind(initsock6, (struct sockaddr *)&sin6, sizeof(sin6))< 0) {
++ warn("bind error; the socket is already used");
++ close(initsock6);
++ initsock6 = -1;
++ }
++#endif
++ if (initsock < 0
++#ifdef PF_INET6
++ && initsock6 < 0
++#endif
++ )
++ exit(1);
++ if (initsock >= 0 && listen(initsock, MAXQUE) < 0)
+ err("listen error; something wrong happened with the socket");
++#ifdef PF_INET6
++ if (initsock6 >= 0 && listen(initsock6, MAXQUE) < 0)
++ err("listen error; something wrong happened with the IPv6 socket");
++#endif
+ if (debug) {
+ fprintf(errout, "file descriptor for initsock is %d\n", initsock);
++#ifdef PF_INET6
++ fprintf(errout, "file descriptor for initsock6 is %d\n", initsock6);
++#endif
+ fflush(errout);
+ }
+ }
+@@ -303,8 +363,19 @@
+ mkoldjtab(buf);
+ }
+
++/* using stdio in signal handler is unsafe */
++#ifdef __STDC__
++volatile
++#endif
++int reread_requested;
++
++RETSIGTYPE req_reread()
++{
++ reread_requested = 1;
++}
++
+ /* 1993/6/5 by kam, re-read dictionary by "INT" signal */
+-RETSIGTYPE reread()
++void reread()
+ {
+ if (fclose(jisho) < 0) {
+ fprintf(stderr,
+@@ -455,15 +526,22 @@
+ main_loop()
+ {
+ fd_set readfds, writefds, exceptfds;
+- fd_set getrfds();
++ void getrfds();
+ struct sockaddr_in from;
++#ifdef PF_INET6
++ struct sockaddr_in6 from6;
++#endif
+ int len;
+ register int i;
+
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
+ for(;;) { /* infinite loop; waiting for client's request */
+- readfds = getrfds();
++ if (reread_requested) {
++ reread();
++ reread_requested = 0;
++ }
++ getrfds(&readfds);
+ if (select(MAXDTAB, &readfds, &writefds, &exceptfds, NULL) < 0) {
+ if (errno == EINTR) /* if signal happens */
+ continue;
+@@ -474,16 +552,32 @@
+ fflush(errout);
+ }
+
+- if (FD_ISSET(initsock, &readfds)) {
++ if (initsock >= 0 && FD_ISSET(initsock, &readfds)) {
+ len = sizeof(from);
+ if ((clientsock[nclients ++] = accept(initsock, &from, &len)) < 0) {
+ err("accept error; something wrong happened with the socket");
+ }
+- if (nclients >= MAXDTAB - 3 - debug * 2) {
++ if (nclients >= MAXDTAB - 3
++#ifdef PF_INET6
++ -1
++#endif
++ - debug * 2) {
+ write(clientsock[--nclients], SERVER_FULL, 1);
+ close(clientsock[nclients]);
+ }
+ }
++#ifdef PF_INET6
++ if (initsock6 >= 0 && FD_ISSET(initsock6, &readfds)) {
++ len = sizeof(from6);
++ if ((clientsock[nclients ++] = accept(initsock6, &from6, &len)) < 0) {
++ err("accept error; something wrong happened with the socket");
++ }
++ if (nclients >= MAXDTAB - 4 - debug * 2) {
++ write(clientsock[--nclients], SERVER_FULL, 1);
++ close(clientsock[nclients]);
++ }
++ }
++#endif
+
+ /* naiive scheduling */
+ for (i = 0; i < nclients; i ++)
+@@ -511,16 +605,20 @@
+ * get bit pattern of read file descriptor
+ */
+
+-fd_set getrfds()
++void getrfds(rfds)
++fd_set *rfds;
+ {
+- fd_set rfds;
+ register int i;
+
+- FD_ZERO(&rfds);
+- FD_SET(initsock, &rfds);
++ FD_ZERO(rfds);
++ if (initsock >= 0)
++ FD_SET(initsock, rfds);
++#ifdef PF_INET6
++ if (initsock6 >= 0)
++ FD_SET(initsock6, rfds);
++#endif
+ for (i = 0; i < nclients; i ++)
+- FD_SET(clientsock[i], &rfds);
+- return (rfds);
++ FD_SET(clientsock[i], rfds);
+ }
+
+ /*
+@@ -724,6 +822,9 @@
+ exit(1);
+ }
+ hentry = gethostbyname(hname);
++ if (hentry == NULL) {
++ fprintf(errout, "%s: WARNING: gethostbyname(%s) failed\n", pgmnm, hname);
++ } else {
+ #ifdef NO_ADDR_LIST
+ strcat(hname, ":");
+ strcat(hname, hentry->h_addr);
+@@ -736,6 +837,7 @@
+ strcat(hname, inet_ntoa(*(struct in_addr *)*p++));
+ }
+ #endif
++ }
+ strcat(hname, ": ");
+ }
+
diff --git a/inputmethod/skkserv/patches/patch-ag b/inputmethod/skkserv/patches/patch-ag
new file mode 100644
index 00000000000..f31b2ab24bb
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ag
@@ -0,0 +1,142 @@
+$NetBSD: patch-ag,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- jisyo-tools/skkdic-expr.c.orig Tue Dec 17 14:51:28 1996
++++ jisyo-tools/skkdic-expr.c Mon Nov 6 01:34:22 2000
+@@ -78,59 +78,86 @@
+ }
+ }
+
++#if !defined(dbm_pagfno) || defined(DBM_SUFFIX)
++#define NEW_DB
++#endif
++
+ /* 作業用データベースファイルを削除
+ file_name には content が格納される */
+ static void db_remove_files()
+ {
+- char pag_name[256];
+- char dir_name[256];
++ char db_name[256];
+
+ db_remove_file(file_name);
+- sprintf(pag_name, "%s.pag", file_name);
+- db_remove_file(pag_name);
+- sprintf(dir_name, "%s.dir", file_name);
+- db_remove_file(dir_name);
++#ifdef NEW_DB
++ sprintf(db_name, "%s.db", file_name);
++ db_remove_file(db_name);
++#else
++ sprintf(db_name, "%s.pag", file_name);
++ db_remove_file(db_name);
++ sprintf(db_name, "%s.dir", file_name);
++ db_remove_file(db_name);
++#endif
+
+ if (okurigana_flag) {
+ db_remove_file(okuri_head_name);
+- sprintf(pag_name, "%s.pag", okuri_head_name);
+- db_remove_file(pag_name);
+- sprintf(dir_name, "%s.dir", okuri_head_name);
+- db_remove_file(dir_name);
++#ifdef NEW_DB
++ sprintf(db_name, "%s.db", okuri_head_name);
++ db_remove_file(db_name);
++#else
++ sprintf(db_name, "%s.pag", okuri_head_name);
++ db_remove_file(db_name);
++ sprintf(db_name, "%s.dir", okuri_head_name);
++ db_remove_file(db_name);
++#endif
+
+ db_remove_file(okuri_tail_name);
+- sprintf(pag_name, "%s.pag", okuri_tail_name);
+- db_remove_file(pag_name);
+- sprintf(dir_name, "%s.dir", okuri_tail_name);
+- db_remove_file(dir_name);
++#ifdef NEW_DB
++ sprintf(db_name, "%s.db", okuri_tail_name);
++ db_remove_file(db_name);
++#else
++ sprintf(db_name, "%s.pag", okuri_tail_name);
++ db_remove_file(db_name);
++ sprintf(db_name, "%s.dir", okuri_tail_name);
++ db_remove_file(db_name);
++#endif
+ }
+ }
+
++#ifndef O_EXCL
++#define O_EXCL 0
++#endif
++
+ /* データベースファイルを作成 */
+-static void db_make_files()
++static void db_make_files(tmpdir)
++ char *tmpdir;
+ {
+- sprintf(file_name, "/tmp/skkjisyo.%d", getpid());
++ int pid = getpid();
++ int fd;
++
++ sprintf(file_name, "%s/skkjisyo.%d", tmpdir, pid);
+ if (okurigana_flag) {
+- sprintf(okuri_head_name, "/tmp/skkhead.%d", getpid());
+- sprintf(okuri_tail_name, "/tmp/skktail.%d", getpid());
++ sprintf(okuri_head_name, "%s/skkhead.%d", tmpdir, pid);
++ sprintf(okuri_tail_name, "%s/skktail.%d", tmpdir, pid);
+ }
+
+ db_remove_files();
+- if ((db = dbm_open(file_name, O_RDWR|O_CREAT, 0600)) == NULL){
++ if ((db = dbm_open(file_name, O_RDWR|O_CREAT|O_EXCL, 0600)) == NULL){
+ perror(file_name);
+ exit(1);
+ }
+- if ((dbcontent = fopen(file_name, "w+")) == NULL){
++ if ((fd = open(file_name, O_RDWR|O_CREAT|O_EXCL, 0600)) < 0 ||
++ (dbcontent = fdopen(fd, "w+")) == NULL){
+ perror(file_name);
+ exit(1);
+ }
+ if (okurigana_flag) {
+- if ((okuriheaddb = dbm_open(okuri_head_name, O_RDWR|O_CREAT, 0600))
++ if ((okuriheaddb = dbm_open(okuri_head_name, O_RDWR|O_CREAT|O_EXCL, 0600))
+ == NULL){
+ perror(okuri_head_name);
+ exit(1);
+ }
+- if ((okuritaildb = dbm_open(okuri_tail_name, O_RDWR|O_CREAT, 0600))
++ if ((okuritaildb = dbm_open(okuri_tail_name, O_RDWR|O_CREAT|O_EXCL, 0600))
+ == NULL){
+ perror(okuri_tail_name);
+ exit(1);
+@@ -698,7 +725,7 @@
+ for (key = dbm_firstkey(db); key.dptr != NULL; key = dbm_nextkey(db)) {
+ content = dbm_fetch(db, key);
+ for(i = 0; i < key.dsize; ++ i)
+- putc((key.dptr)[i], output);
++ putc(((char *) key.dptr)[i], output);
+ putc(' ', output);
+ fseek(dbcontent, getpos(content.dptr), 0);
+ db_gets(kanji, BLEN, dbcontent);
+@@ -716,7 +743,7 @@
+ if (entry.dptr != NULL) continue;
+
+ for(i = 0; i < key.dsize; ++ i)
+- putc((key.dptr)[i], output);
++ putc(((char *) key.dptr)[i], output);
+ putc(' ', output);
+ putc('/', output);
+ okuri_type_out(&key, output);
+@@ -775,9 +802,8 @@
+ exit(1);
+ }
+
+- sprintf(file_name, "%s/skkjisyo.%d", tmpdir, getpid());
+ set_signal_handler();
+- db_make_files();
++ db_make_files(tmpdir);
+
+ negate = 0;
+ for (; i < argc; ++ i) {
diff --git a/inputmethod/skkserv/patches/patch-ah b/inputmethod/skkserv/patches/patch-ah
new file mode 100644
index 00000000000..3bb6012ea68
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1.1.1 2002/05/31 12:59:58 seb Exp $
+
+--- jisyo-tools/skkdic-sort.c-orig Tue Dec 17 06:51:28 1996
++++ jisyo-tools/skkdic-sort.c Sun Nov 18 13:01:23 2001
+@@ -22,7 +22,7 @@
+ */
+
+ #include <stdio.h>
+-#ifndef NO_MALLOC_H
++#ifdef HAVE_MALLOC_H
+ #include <malloc.h>
+ #endif
+
diff --git a/inputmethod/skkserv/patches/patch-bsearch b/inputmethod/skkserv/patches/patch-bsearch
new file mode 100644
index 00000000000..5cc1c2a22b7
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-bsearch
@@ -0,0 +1,123 @@
+$NetBSD: patch-bsearch,v 1.1.1.1 2002/05/31 12:59:59 seb Exp $
+
+Binary search patch.
+Originally from skk-users mailing list
+(Masahiro Doteguchi, Mailinglist-Id: 1779).
+
+--- skkserv/skkserv.c.patch1 Mon Nov 6 00:12:57 2000
++++ skkserv/skkserv.c Mon Nov 6 00:15:00 2000
+@@ -109,7 +109,7 @@
+ * Global Variables
+ */
+
+-char pgmver[] = "3.9.4nb1 "; /* version number */
++char pgmver[] = "3.9.4nb1 (binary search) "; /* version number */
+
+ char *pgmnm; /* program name */
+ char *jname; /* name of shared dictionary */
+@@ -622,7 +622,7 @@
+ }
+
+ /*
+- * reply to client: linear search
++ * reply to client: binary search
+ */
+
+ search(commsock)
+@@ -635,6 +635,7 @@
+ int n; /* number of characters from client */
+ int sttpnt; /* start point of searching */
+ int endpnt; /* end point of searching */
++ int curpnt; /* current point of searching */
+ int errcod = 0; /* error flag */
+ int sstyle; /* search style */
+
+@@ -743,18 +744,36 @@
+ endpnt = jtab1[KANA_END - code + 1];
+ }
+ }
+- fseek(jisho, sttpnt, 0);
+ if (debug)
+- fprintf(stderr, "from %d to %d\n", sttpnt, endpnt);
++ fprintf(errout, "from %d to %d\n", sttpnt, endpnt);
+
+- while ((c = fgetc(jisho)) != EOF) {
++ for (;;) {
++ if ((sstyle & 0x4) == 0) { /* binary search? */
++ curpnt = (sttpnt + endpnt) / 2;
++ fseek(jisho, curpnt, 0);
++ while ((c = fgetc(jisho)) != EOF) {
++ curpnt++;
++ if (c == EOL) break;
++ }
++ if (c == EOF) break;
++ if (curpnt >= endpnt) {
++ fseek(jisho, sttpnt, 0);
++ sstyle |= 0x4; /* linear search */
++ }
++ }
++
++ if (debug) {fprintf(errout, "%d:%d\t%d\t%d\t", sstyle, sttpnt, curpnt, endpnt);}
++ c = fgetc(jisho);
+ pbuf = &combuf[1]; /* ' ' is end-symbol */
+ while (c == *pbuf && c != ' ' && c != EOL) {
+- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
++/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
++ if (debug) {fprintf(errout, "%c", c);}
+ c = fgetc(jisho); pbuf++;
+- }
+- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
++ }
++/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
++ if (debug) {fprintf(errout, "%c", c);}
+ if (c == ' ' && (*pbuf == ' ' || *pbuf == '\n')) { /* found */
++ if (debug) {fprintf(errout, "found\n");}
+ if ((errcod = write(commsock, SERVER_FOUND, 1)) >= 0)
+ while ((c = fgetc(jisho)) != EOF) {
+ *pbuf = c;
+@@ -770,18 +789,35 @@
+ }
+ return(0);
+ }
+- if (comp(*pbuf, c, sstyle)) {
+- if (debug) {
+- fprintf(stderr, "comp break %d \n", ftell(jisho));
+- }
+- break;
++ if (debug) {
++ int ch;
++
++ if (c != ' ')
++ do {
++ ch = fgetc(jisho);
++ fprintf(errout, "%c", ch);
++ } while (ch != ' ' && ch != EOL);
++ fprintf(errout, "unmatched\n");
+ }
+- /* fix 1992/3/6 under suggestion */
+- /* of guchi@pfu.fujitsu.co.jp */
+- while ((c = fgetc(jisho)) != EOF) {
+- if (c == EOL) break;
++ if (sstyle & 0x4) {
++ if (comp(*pbuf, c, sstyle&~0x4)) {
++ if (debug) {
++ fprintf(stderr, "comp break %d \n", ftell(jisho));
++ }
++ break;
++ }
++ /* fix 1992/3/6 under suggestion */
++ /* of guchi@pfu.fujitsu.co.jp */
++ while ((c = fgetc(jisho)) != EOF) {
++ if (c == EOL) break;
++ }
++ if (ftell(jisho) >= endpnt) break;
++ } else {
++ if (comp(*pbuf, c, sstyle&~0x4))
++ endpnt = curpnt;
++ else
++ sttpnt = curpnt;
+ }
+- if (ftell(jisho) >= endpnt) break;
+ }
+
+ if ((errcod = write(commsock, SERVER_NOT_FOUND, 1)) >= 0) {
diff --git a/inputmethod/skkserv/patches/patch-jisyo b/inputmethod/skkserv/patches/patch-jisyo
new file mode 100644
index 00000000000..d00792dab62
--- /dev/null
+++ b/inputmethod/skkserv/patches/patch-jisyo
@@ -0,0 +1,112 @@
+$NetBSD: patch-jisyo,v 1.1.1.1 2002/05/31 12:59:59 seb Exp $
+
+Dictionary (SKK-JISYO.L) corrigenda.
+Partially from skk-dic mailing list.
+
+--- jisyo/SKK-JISYO.L.fix1 Mon Dec 20 16:28:52 1999
++++ jisyo/SKK-JISYO.L Mon Dec 27 23:53:47 1999
+@@ -3530,7 +3530,7 @@
+ しりあe /知り合/
+ しらべr /調べ/
+ しらじらs /白々/
+-しらs /報/知ら/知らせ/
++しらs /報/知ら/
+ しらm /白/
+ しらk /白/
+ しらb /調/
+@@ -4216,9 +4216,9 @@
+ ぐi /食/
+ くんよm /訓読/
+ くんづk /君付/
+-くわわt /加/
++くわわt /加わ/
+ くわだt /企/
+-くわw /加わ/
++くわw /加/
+ くわs /詳/加/
+ くわk /区分/
+ くわe /加/咥/銜/加え/
+@@ -30746,7 +30746,7 @@
+ がいかんび /外観美/
+ がいき /外気/
+ がいきおん /外気温/
+-がいきょう /概況/外匡/
++がいきょう /概況/外筐/
+ がいきょく /外局/
+ がいきれいぼう /外気冷房/
+ がいきん /外勤/
+@@ -34044,7 +34044,7 @@
+ きゅうきゅうたい /救急隊/
+ きゅうきゅうばこ /救急箱/
+ きゅうきゅうばんそうこう /救急絆創膏/
+-きゅうきょ /急拠/急遽/急きょ/
++きゅうきょ /急遽/急きょ/
+ きゅうきょう /窮境/
+ きゅうきょうさんけんしょこく /旧共産圏諸国/
+ きゅうきょうしょくいん /旧教職員/
+@@ -35040,9 +35040,9 @@
+ きょうぞんきょうえい /共存共栄/
+ きょうぞんほう /共存法/
+ きょうぞんほうほう /共存方法/
+-きょうたい /匡体/筐体/狂態/矯態/嬌態/筺体/
++きょうたい /筐体/狂態/嬌態/
+ きょうたいいき /狭帯域/
+-きょうたいじっそうぎじゅつ /匡体実装技術/
++きょうたいじっそうぎじゅつ /筐体実装技術/
+ きょうたく /供託/教卓/
+ きょうたくきん /供託金/
+ きょうたくしょ /供託所/
+@@ -36904,7 +36904,7 @@
+ ぎじんほう /擬人法/
+ ぎせい /犠牲/擬声/擬制/
+ ぎせいご /擬声語/
+-ぎせいしゃ /儀牲者/犠牲者/
++ぎせいしゃ /犠牲者/
+ ぎせき /議席/
+ ぎせきすう /議席数/
+ ぎせきはいぶん /議席配分/
+@@ -42867,7 +42867,7 @@
+ こうぎせきぶん /広義積分/
+ こうぎたいしょう /抗議対象/
+ こうぎちゅう /講義中/
+-こうぎとう /講義搭/講義棟/
++こうぎとう /講義棟/
+ こうぎないよう /講義内容/
+ こうぎぶん /抗議文/
+ こうぎめい /講義名/
+@@ -84011,7 +84011,7 @@
+ とうじゅうろう /藤十郎/
+ とうじゆうめい /当時有名/
+ とうじょ /唐書/
+-とうじょう /登場/搭乗/東條/東条/棟上/東上/塔乗/頭状/東城/筒状/
++とうじょう /登場/搭乗/東條/東条/棟上/東上/頭状/東城/筒状/
+ とうじょういぜん /登場以前/
+ とうじょういらい /登場以来/
+ とうじょういん /搭乗員/
+@@ -84025,7 +84025,7 @@
+ とうじょうご /登場後/
+ とうじょうしゃ /搭乗者/
+ とうじょうしゃほけん /搭乗者保険/
+-とうじょうじ /塔乗時/登場時/
++とうじょうじ /搭乗時/登場時/
+ とうじょうじっせき /搭乗実績/
+ とうじょうじんぶつ /登場人物/
+ とうじょうじんぶつたち /登場人物達/
+@@ -84038,7 +84038,7 @@
+ とうじょうとうじ /登場当時/
+ とうじょうばめん /登場場面/
+ とうじょうばんぐみ /登場番組/
+-とうじょうび /塔乗日/搭乗日/
++とうじょうび /搭乗日/
+ とうじょうびん /搭乗便/
+ とうじょうまえ /登場前/搭乗前/
+ とうじょうよてい /登場予定/搭乗予定/
+@@ -93140,7 +93140,7 @@
+ はげたか /禿鷹/
+ はげやま /禿山/
+ はげん /波源/
+-はこ /箱/函/運/葉子/□/匡/凾/筥/箪/匣/
++はこ /箱/函/運/葉子/□/筐/凾/筥/箪/匣/
+ はこいり /箱入り/箱入/
+ はこう /破口/跛行/波高/
+ はこうぶんぷ /波高分布/