Codebase list dbskkd-cdb / 11b7503
Imported Debian patch 1:1.01-17 Tatsuya Kinoshita 9 years ago
11 changed file(s) with 133 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
7171 #include <signal.h>
7272 #include <limits.h>
7373 #include <syslog.h>
74 #include <cdb.h>
74 #include "cdb.h"
7575
7676 /* architectural dependencies */
7777
148148 register unsigned char *pbuf, *key, *p;
149149 int length, errcode, get_status;
150150 unsigned int keylen;
151 unsigned datalen;
151 uint32 datalen;
152152
153153 length = read(STDIN, &combuf[0], BUFSIZE - 1);
154154 if (length < 0) {
00 dbskkd-cdb for Debian
11 ----------------------
22
3 This package uses `/usr/share/skk/SKK-JISYO.cdb', dictionary file of the
4 skkdic-cdb package.
3 This package uses the SKK dictionary cdb file
4 `/usr/share/skk/SKK-JISYO.cdb' that is provided by the skkdic-cdb package.
55
6 If you want to make your own dictionary for dbskkd-cdb, use
7 examples/makeskkcdbdic. Note you must install the tinycdb package to use
8 makeskkcdbdic.
6 If you want to convert your own dictionary to cdb, use the
7 `makeskkcdbdic' command. Note that this command requires the tinycdb
8 package. See also the manpage makeskkcdbdic(1).
99
10 -- Tatsuya Kinoshita <tats@debian.org>, Mon, 14 Aug 2006 06:14:05 +0900
10 -- Tatsuya Kinoshita <tats@debian.org>, Sun, 3 Sep 2006 07:59:54 +0900
0 dbskkd-cdb (1:1.01-17) unstable; urgency=low
1
2 * debian/patches/tinycdb-seek.patch: Fix that cdb_seek() fails if datalen
3 is zero. (Workaround for cdb_seek() bug in tinycdb, Debian bug#383417)
4 * debian/patches/datalen-type.patch: Fix that cdb_seek() fails on 64bit
5 systems. Use unsigned int instead of uint32 for datalen and use
6 tinycdb's header. (already fixed in version 1:1.01-14)
7 * debian/patches/awk-locale.patch: Set LC_ALL to C for awk.
8 * Depend on quilt (>= 0.40) to handle patches at build time.
9 * debian/rules: Install `debian/makeskkcdbdic' into `/usr/bin'.
10 * debian/rules: Install manpage `debian/makeskkcdbdic.1'.
11 * debian/rules: Install `skktocdbm.sh' into `/usr/share/dbskkd-cdb'.
12 * debian/makeskkcdbdic: Set LC_ALL to C for awk.
13 * debian/makeskkcdbdic: Check whether cdb command exists.
14 * debian/makeskkcdbdic.1: New file.
15 * debian/control: Move tinycdb from `Suggests' to `Recommends'.
16 * debian/control (Description): Revised.
17 * debian/README.Debian: Revised.
18
19 -- Tatsuya Kinoshita <tats@debian.org> Sun, 3 Sep 2006 22:52:22 +0900
20
021 dbskkd-cdb (1:1.01-16) unstable; urgency=low
122
223 * debian/control: Remove `skksearch' from `Conflicts' and `Replaces',
11 Section: utils
22 Priority: optional
33 Maintainer: Tatsuya Kinoshita <tats@debian.org>
4 Build-Depends: debhelper (>= 5), tinycdb
4 Build-Depends: debhelper (>= 5), tinycdb, quilt (>= 0.40)
55 Standards-Version: 3.7.2
66
77 Package: dbskkd-cdb
99 Provides: skkserv
1010 Conflicts: skkserv
1111 Replaces: skkserv
12 Suggests: tinycdb
12 Depends: ${shlibs:Depends}, skkdic-cdb, netbase
13 Recommends: tinycdb
1314 Enhances: ddskk | skk
14 Depends: ${shlibs:Depends}, skkdic-cdb, netbase
1515 Description: SKK dictionary server using cdb for faster access
1616 dbskkd-cdb is a dictionary server for SKK Japanese input systems,
1717 using D. J. Bernstein's cdb database for faster dictionary access.
1818 .
1919 dbskkd-cdb is compatible with skkserv on the protocol behavior.
2020 It is called from an internet super-server.
21 .
22 This package uses the SKK dictionary cdb file `SKK-JISYO.cdb' that
23 is provided by the skkdic-cdb package.
24 .
25 If you want to convert your own dictionary to cdb, use the
26 `makeskkcdbdic' command. This command requires the tinycdb package.
27 .
28 Homepage: http://www.ne.jp/asahi/bdx/info/software/jp-dbskkd.html
00 #!/bin/sh
11 set -e
22
3 CDB="`which cdb`" || CDB=""
4 if [ -z "$CDB" ]; then
5 echo "${0##*/}: tinycdb's cdb command not found" >&2
6 exit 1
7 fi
8
39 if [ $# -eq 0 ]; then
4 echo "Usage: ${0##*/} SKK-JISYO [SKK-JISYO-CDB]" >&2
10 echo "usage: ${0##*/} SKK-JISYO [SKK-JISYO-CDB]" >&2
511 exit 1
612 fi
713
1824 tmpf=`tempfile -d "$dir" -m 0644`
1925 trap 'rm -f "$tmpf"' EXIT INT TERM
2026
21 awk '
27 LC_ALL=C awk '
2228 /^[^;]/ {
2329 s = substr($0, index($0, " ") + 1)
2430 print "+" length($1) "," length(s) ":" $1 "->" s
2632 END {
2733 print ""
2834 }
29 ' "$1" | cdb -c -t "$tmpf" "$2"
35 ' "$1" | "$CDB" -c -t "$tmpf" "$2"
0 .TH MAKESKKCDBDIC 1
1 .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
2 .\" other parms are allowed: see man(7), man(1)
3 .SH NAME
4 makeskkcdbdic \- SKK dictionary file to cdb converter
5 .SH SYNOPSIS
6 .B makeskkcdbdic
7 SKK-JISYO [SKK-JISYO-CDB]
8 .SH DESCRIPTION
9 makeskkcdbdic converts SKK dictionary plain text file SKK-JISYO to cdb (DJB's constant database) file SKK-JISYO-CDB or SKK-JISYO+".cdb".
10 .PP
11 This command is a improvement of dbskkd-cdb's `makeskkcdb.sh'.
12 .PP
13 This command requires tinycdb's `cdb' command.
14 .SH EXAMPLES
15 .SS Convert SKK-JISYO.foobar to SKK-JISYO.foobar.cdb
16 .na
17 .nf
18 makeskkcdbdic SKK-JISYO.foobar
19 or
20 makeskkcdbdic SKK-JISYO.foobar SKK-JISYO.foobar.cdb
21 .fi
22 .ad
23 .SH BUGS
24 This command is provided by Debian.
25 It is not integrated in the upstream source.
26 .SH SEE ALSO
27 dbskkd-cdb(8)
28 .\" This manual page is written by Tatsuya Kinoshita <tats@debian.org>.
29 .\" Unlimited permission is granted to use, copy, distribute and/or modify
30 .\" this file. There is NO WARRANTY.
0 --- dbskkd-cdb-1.01-16/skktocdbm.sh 1998-12-12 20:11:35.000000000 +0900
1 +++ dbskkd-cdb-1.01/skktocdbm.sh 2006-09-03 07:50:37.000000000 +0900
2 @@ -4,7 +4,7 @@
3 # Originally by D. J. Bernstein's 12tocdbm.sh
4 # modified by Kenji Rikitake
5 # bugfix of truncated strings by Hideto Kihara
6 -awk '
7 +LC_ALL=C awk '
8 /^[^;]/ {
9 s = substr($0, index($0, " ") + 1)
10 print "+" length($1) "," length(s) ":" $1 "->" s
0 diff -urN dbskkd-cdb-1.01.orig/dbskkd-cdb.c dbskkd-cdb-1.01/dbskkd-cdb.c
1 --- dbskkd-cdb-1.01.orig/dbskkd-cdb.c 1999-09-28 21:14:47.000000000 +0900
2 +++ dbskkd-cdb-1.01/dbskkd-cdb.c 2006-08-13 17:26:58.000000000 +0900
3 @@ -72,7 +72,7 @@
4 #include <signal.h>
5 #include <limits.h>
6 #include <syslog.h>
7 -#include "cdb.h"
8 +#include <cdb.h>
9
10 /* architectural dependencies */
11
12 @@ -149,7 +149,7 @@
13 register unsigned char *pbuf, *key, *p;
14 int length, errcode, get_status;
15 unsigned int keylen;
16 - uint32 datalen;
17 + unsigned int datalen;
18
19 length = read(STDIN, &combuf[0], BUFSIZE - 1);
20 if (length < 0) {
0 datalen-type.patch
1 tinycdb-seek.patch
2 awk-locale.patch
0 diff -urN dbskkd-cdb-1.01-16/dbskkd-cdb.c dbskkd-cdb-1.01/dbskkd-cdb.c
1 --- dbskkd-cdb-1.01-16/dbskkd-cdb.c 2006-08-13 17:26:58.000000000 +0900
2 +++ dbskkd-cdb-1.01/dbskkd-cdb.c 2006-09-01 21:37:35.000000000 +0900
3 @@ -199,6 +199,7 @@
4 /* NOTREACHED */
5 }
6 else {
7 + datalen = 1; /* workaround for cdb_seek() bug in tinycdb, Debian bug#383417 */
8 get_status = cdb_seek(jisho_fd, key, keylen, &datalen);
9 }
10 switch (get_status) {
33 # Uncomment this to turn on verbose mode.
44 #export DH_VERBOSE=1
55
6 include /usr/share/quilt/quilt.make
7
68 CFLAGS := -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
79
810 build: build-stamp
9 build-stamp:
11 build-stamp: debian/stamp-patched
1012 dh_testdir
1113
1214 $(MAKE) SERVERDIR=/usr/sbin\
1315 CC='gcc $(CFLAGS)'\
1416 COMPAT='-DJISHO_FILE=\"/usr/share/skk/SKK-JISYO.cdb\"'\
1517 LDFLAGS=-lcdb
16 chmod +x debian/makeskkcdbdic
1718
1819 touch build-stamp
1920
20 clean:
21 clean: unpatch
2122 dh_testdir
2223 dh_testroot
2324 rm -f build-stamp
3334 dh_installdirs
3435
3536 dh_install dbskkd-cdb usr/sbin
37 dh_install debian/makeskkcdbdic usr/bin
38 dh_install skktocdbm.sh usr/share/dbskkd-cdb
3639
3740 # Build architecture-independent files here.
3841 binary-indep: build install
4548 dh_installdocs Release-Notes.*
4649 dh_installexamples debian/makeskkcdbdic
4750 dh_installman debian/dbskkd-cdb.8
51 dh_installman debian/makeskkcdbdic.1
4852 dh_link
4953 dh_strip
5054 dh_compress