--- xjdic-24.orig/xjdic.1 +++ xjdic-24/xjdic.1 @@ -434,6 +434,12 @@ set the initial default input mode to hiragana .At +.B exactmatch +[SA,CL] +.Ap +toggles the exact match option +.At + .B dicdir path_name [SA,SV,CL] .Ap --- xjdic-24.orig/xjdic.h +++ xjdic-24/xjdic.h @@ -2,8 +2,8 @@ #define MAXCOLS 80 /* default cols per display */ #define NRKANA 250*2 /* size of the romaji to kana tables*/ #define NOFILT 10 /* maximum number of general filters */ -#define VMAX 350 /* maximum entries in the verb table */ -#define DEFAULT_DICDIR "" /* could be: "/usr/local/lib/xjdic" */ +#define VMAX 600 /* maximum entries in the verb table */ +#define DEFAULT_DICDIR "/var/lib/xjdic" /* could be: "/usr/local/lib/xjdic" */ #define NOHITS 1000 /* size of hittab */ #define SPTAG '@' /* character that flags priority entries */ #define KFBUFFSIZE 2000 /* size of the KFlush buffer */ @@ -19,6 +19,9 @@ lookup (default 20) */ #define MAXITER 40 /*maximum binary search iterations*/ +#define MAX_ENTRY_SIZE 4096 /* maximum size of an edict entry */ + /* (this only applies to the stand-alone client) */ + /* The following is for Solarises */ #ifndef SEEK_END --- xjdic-24.orig/xjdsa.c +++ xjdic-24/xjdsa.c @@ -186,7 +186,7 @@ *dic_loc = schix; for (i = 0; dbchar(schix+i) != 0x0a; i++) { - if (i == 512) + if (i == MAX_ENTRY_SIZE) { printf ("Reply overrun\n"); exit(1); --- xjdic-24.orig/xjdxgen.c +++ xjdic-24/xjdxgen.c @@ -23,9 +23,10 @@ #include #include -/*#include */ +#include #include #include +#include #include "xjdic.h" #define TRUE 1 --- xjdic-24.orig/Makefile +++ xjdic-24/Makefile @@ -55,7 +55,7 @@ #LIBS= -lsocket -lnsl # CC=gcc -g -all: xjdic_sa xjdic_cl xjdserver xjdxgen exjdxgen +all: xjdic_sa xjdic_cl xjdserver xjdxgen exjdxgen xjdrad client: xjdic_cl server: xjdserver stand: xjdic_sa @@ -123,11 +123,17 @@ xjdserver.o: xjdserver.c $(CC) -c $(SVCFLAGS) xjdserver.c $(SVOBJECTS): xjdic.h + +# xjdrad +xjdrad: xjdrad.c + $(CC) $^ -o $@ + + # clean: rm -f *.o realclean: clean - rm -f xjdic_sa xjdic_cl xjdserver xjdxgen exjdxgen + rm -f xjdic_sa xjdic_cl xjdserver xjdxgen exjdxgen xjdrad # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by --- xjdic-24.orig/xjdserver.c +++ xjdic-24/xjdserver.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include +#include #include "xjdic.h" #define SVERBOSE 0 @@ -56,8 +58,6 @@ int thisdic = 0; int DicNum; -extern int errno; - extern unsigned char Dnamet[10][100],XJDXnamet[10][100]; extern unsigned char *dicbufft[10]; extern unsigned long diclent[10], indlent[10],indptrt[10]; @@ -463,7 +463,7 @@ { pdu_out.xjdrsp_resindex = htonl(schix); } - for (i = 0; dbchar(schix+i) != 0x0a; i++) + for (i = 0; i < 510 && dbchar(schix+i) != 0x0a; i++) { pdu_out.xjdrsp_resstr[i] = dbchar(schix+i); } --- xjdic-24.orig/xjdfrontend.c +++ xjdic-24/xjdfrontend.c @@ -21,11 +21,15 @@ #include #include #include +#ifdef __GNU__ +#include +#endif #include #include #include #include #include +#include #include "xjdic.h" /* Paul Burchard supplied a patch to provide BSD compatibility for xjdic @@ -33,10 +37,14 @@ order to enable this, people should compile with the option -D__STRICT_BSD___ . */ +#if defined(__FreeBSD_kernel__) +#define __STRICT_BSD__ +#endif + #ifdef __STRICT_BSD__ #include #else -#ifdef __POSIX__ +#if defined(__POSIX__) || defined(__GNU__) #include #else #include @@ -55,6 +63,8 @@ #ifdef __STRICT_BSD__ static struct sgttyb orig,new; +#elif defined(__GNU__) +static struct termios orig,new; #else static struct termio orig,new; #endif @@ -242,10 +252,11 @@ new.sg_flags |= CBREAK; new.sg_flags &= ~ECHO; ioctl(0, TIOCSETP, &new); #else - ioctl(0, TCGETA, &orig); ioctl(0, TCGETA, &new); + tcgetattr(0, &orig); tcgetattr(0, &new); new.c_lflag &= ~ICANON; new.c_lflag &= ~ISIG; new.c_lflag &= ~ECHO; new.c_lflag &= ~IXON; - new.c_cc[4] = 1; new.c_cc[5] = 0; ioctl(0, TCSETA, &new); + new.c_cc[VMIN] = 1; new.c_cc[VTIME] = 0; + tcsetattr(0, TCSANOW, &new); #endif myi_status=IOCTL_RAW; } @@ -257,7 +268,7 @@ #ifdef __STRICT_BSD__ ioctl(0, TIOCSETP, &orig); #else - ioctl(0, TCSETA, &orig); + tcsetattr(0, TCSANOW, &orig); #endif myi_status = IOCTL_ORIG; } @@ -1066,7 +1077,7 @@ { int xjresp,roff,rlen; - unsigned char repstr[512]; + unsigned char repstr[MAX_ENTRY_SIZE]; long respos; int hit,schix; unsigned char khi,klo,cc,ops[4]; @@ -1255,7 +1266,7 @@ unsigned char vlast[11],temp[11],ops[80]; int vi,vok,prevch,KDNSflag,KDskip,KTest; int xjresp,roff,rlen; - unsigned char repstr[512]; + unsigned char repstr[MAX_ENTRY_SIZE]; unsigned long respos; vlast[0] = 0; --- xjdic-24.orig/xjdclient.c +++ xjdic-24/xjdclient.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #define CVERBOSE 0 int chk_cnt=0; -extern int errno; unsigned char host[51] = {"localhost"}; unsigned char yn[2]; unsigned int portno = XJ_PORTNO; --- xjdic-24.orig/debian/dirs +++ xjdic-24/debian/dirs @@ -0,0 +1,6 @@ +usr/bin +usr/sbin +var/lib/xjdic +usr/share/man/man1 +usr/share/man/man8 +usr/share/doc/xjdic --- xjdic-24.orig/debian/docs +++ xjdic-24/debian/docs @@ -0,0 +1,4 @@ +xjdic22.WHATSNEW +xjdic23.WHATSNEW +xjdic24.WHATSNEW +xjdic24.txt --- xjdic-24.orig/debian/control +++ xjdic-24/debian/control @@ -0,0 +1,16 @@ +Source: xjdic +Section: text +Priority: optional +Maintainer: Ludovic Drolez +Build-Depends: debhelper (>> 3.0.0) +Standards-Version: 3.9.3 + +Package: xjdic +Architecture: any +Depends: ${shlibs:Depends}, edict, kanjidic, ${misc:Depends} +Recommends: kterm +Description: Japanese-English dictionary search program + XJDIC is an electronic Japanese-English dictionary program designed to + operate in the X11 window environment. In particular, it must run in an + "xterm" environment which has Japanese language support such as provided by + "kterm" etc. --- xjdic-24.orig/debian/links +++ xjdic-24/debian/links @@ -0,0 +1,5 @@ +usr/share/man/man1/xjdic.1 usr/share/man/man1/xjdic_cl.1 +usr/share/man/man1/xjdic.1 usr/share/man/man1/xjdic_sa.1 +usr/share/man/man1/xjdic.1 usr/share/man/man1/xjdserver.1 +usr/share/man/man1/xjdic.1 usr/share/man/man1/xjdxgen.1 +usr/share/man/man1/xjdic.1 usr/share/man/man1/exjdxgen.1 --- xjdic-24.orig/debian/prerm +++ xjdic-24/debian/prerm @@ -0,0 +1,43 @@ +#! /bin/sh +# prerm script for xjdic +# +# see: dh_installdeb(1) + +DICTDIR=/var/lib/xjdic + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ + +case "$1" in + remove) + cd $DICTDIR + rm -f * + ;; + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/xjdic.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- xjdic-24.orig/debian/rules +++ xjdic-24/debian/rules @@ -0,0 +1,112 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export CFLAGS := -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O3 +endif + +DH_STRIP=dh_strip +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + DH_STRIP=true +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) CC="gcc $(CFLAGS)" + #/usr/bin/docbook-to-man debian/test-s.sgml > test-s.1 + cp -f xjdic24.inf xjdic24.txt + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up after the build process. + $(MAKE) realclean + rm -f xjdic24.txt + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/test-s. +# $(MAKE) install DESTDIR=$(CURDIR)/debian/test-s + install -m 755 exjdxgen debian/xjdic/usr/bin/exjdxgen + install -m 755 xjdic_cl debian/xjdic/usr/bin/xjdic_cl + install -m 755 xjdic_sa debian/xjdic/usr/bin/xjdic_sa + ln -sf xjdic_sa debian/xjdic/usr/bin/xjdic + install -m 755 xjdserver debian/xjdic/usr/bin/xjdserver + install -m 755 xjdxgen debian/xjdic/usr/bin/xjdxgen + install -m 755 xjdrad debian/xjdic/usr/bin/xjdrad + install -m 755 debian/xjdicconfig \ + debian/xjdic/usr/sbin/xjdicconfig + install -m 644 debian/.xjdicrc.skel \ + debian/xjdic/usr/share/doc/xjdic/dot.xjdicrc + install -m 644 xjdic.1 debian/xjdic/usr/share/man/man1/xjdic.1 + install -m 644 debian/xjdicconfig.man \ + debian/xjdic/usr/share/man/man8/xjdicconfig.8 + install -m 644 kanjstroke debian/xjdic/var/lib/xjdic + install -m 644 radicals.tm debian/xjdic/var/lib/xjdic + install -m 644 radkfile debian/xjdic/var/lib/xjdic + install -m 644 romkana.cnv debian/xjdic/var/lib/xjdic + install -m 644 vconj debian/xjdic/var/lib/xjdic + ln -sf /usr/share/common-licenses/GPL debian/xjdic/var/lib/xjdic/gnu_licence + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + $(DH_STRIP) + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- xjdic-24.orig/debian/watch +++ xjdic-24/debian/watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic([\d\.]*)\.tgz debian uupdate --- xjdic-24.orig/debian/changelog +++ xjdic-24/debian/changelog @@ -0,0 +1,128 @@ +xjdic (24-8) unstable; urgency=low + + * xjdicconfig man page belongs to section 8. Closes: #512452 + * fixed a FTBFS on hurd-i386. Closes: #670884 + * fixed the "Reply overrun". Closes: #475836 + + -- Ludovic Drolez Tue, 08 May 2012 18:22:22 +0200 + +xjdic (24-7) unstable; urgency=medium + + * Fixed the FTBFS on GNU/kFreeBSD. Urgency set to medium. Closes: #414208 + * Added xjdrad. Closes: #438831 + * Bad usage of termios constants was breaking xjdic on PowerPC. + Closes: #258111 + + -- Ludovic Drolez Mon, 12 Mar 2007 18:32:07 +0100 + +xjdic (24-6) unstable; urgency=low + + * fix for a segfault on ia64. Closes: #325787 + + -- Ludovic Drolez Thu, 1 Sep 2005 10:43:02 +0200 + +xjdic (24-5) unstable; urgency=low + + * set VMAX to 600 to avoid verb data overflow. Closes: #253995 + + -- Ludovic Drolez Fri, 1 Apr 2005 22:32:45 +0200 + +xjdic (24-4) unstable; urgency=low + + * Debian watch file added + * Applied a patch for amd64. Closes: Bug#280315. + + -- Ludovic Drolez Sat, 13 Nov 2004 22:06:26 +0200 + +xjdic (24-3) unstable; urgency=low + + * Symlink to GNU license corrected. Closes: #204782. + + -- Ludovic Drolez Mon, 11 Aug 2003 19:56:37 +0200 + +xjdic (24-2) unstable; urgency=low + + * Only depends on DFSG compliant packages, so now moved in free. + * The GNU license is now displayed correctly with the '!' key + + -- Ludovic Drolez Sat, 26 Jul 2003 23:23:27 +0200 + +xjdic (24-1) unstable; urgency=low + + * New upstream release + + -- Ludovic Drolez Sun, 22 Jun 2003 23:17:05 +0200 + +xjdic (23-5) unstable; urgency=low + + * Segfault bug fixed thanks to Jim Breen. Closes: Bug#180836 + + -- Ludovic Drolez Thu, 22 May 2003 23:53:12 +0200 + +xjdic (23-4) unstable; urgency=low + + * New maintainer. Closes: Bug#192688 + * Take into account DEB_BUILD_OPTIONS + * More dictionaries in /usr/sbin/xjdicconfig. Closes: Bug#141321 + * Exact match option for .xjdicrc. Closes: Bug#152105 + + -- Ludovic Drolez Wed, 21 May 2003 15:40:31 +0200 + +xjdic (23-3) unstable; urgency=low + + * Put edict and kanjidict to depends list. (closes: #88117) + + -- Hayao Nakahara Thu, 27 Dec 2001 04:50:09 +0900 + +xjdic (23-2) unstable; urgency=low + + * Initial Debian Release. + + -- Hayao Nakahara Tue, 19 Oct 1999 01:18:34 +0900 + +xjdic (23-1) unstable; urgency=low + + * new upstream source. + + -- Hayao Nakahara Sun, 16 May 1999 16:56:53 +0900 + +xjdic (22-5) frozen-jp unstable-jp; urgency=low + + * changed the dictionary directory to /var/lib/xjdic. + * added xjdicconfig. + + -- Hayao Nakahara Thu, 26 Nov 1998 04:53:58 +0900 + +xjdic (22-4) contrib; urgency=low + + * compiled with libc6. + * applied some of patches by Katsuya Nagai (katsuya@kcn.or.jp). + * moved dictionary directory to /usr/share/dict. + * fixed xjdxgen.c. + * fixed bugs: JP/134, JP/150. + * fixed postinst. + + -- Hayao Nakahara Thu, 21 May 1998 00:57:41 +0900 + +xjdic (22-3) contrib-jp; urgency=low + + * fixed the location of _xjdicrc.expamle. + * put edict to Depends. + + -- Hayao Nakahara Tue, 22 Apr 1997 21:00:26 +0900 + +xjdic (22-2) unstable; urgency=low + + * Fixed dependency. + + -- Hayao Nakahara Thu, 30 Jan 1997 15:33:24 +0900 + +xjdic (22-1) unstable; urgency=low + + * Initial Release. + + -- Hayao Nakahara Sat, 16 Nov 1996 19:49:01 +0900 + +Local variables: +mode: debian-changelog +End: --- xjdic-24.orig/debian/xjdicconfig.man +++ xjdic-24/debian/xjdicconfig.man @@ -0,0 +1,33 @@ +.TH XJDICCONFIG 8 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +xjdicconfig \- program to create index files for xjdic program. +.SH SYNOPSIS +.B xjdicconfig +.br +.B xjdicconfig +.I "dict ..." +.SH "DESCRIPTION" +.BR xjdicconfig +make index files for xjdic programs. +If arguments are given, +.BR xjdicconfig +make index files of dictionaries +specified by arguments. +Without arguments, +.BR xjdicconfig +make index files all available dictionaries. +.SH FILES +.TP +.I /usr/share/edict +Directory for dictionaries in +.I edict +format. +.TP +.I /var/lib/xjdic +Directory for index files. +Symbolic links to dictionries must exists in this directory. +.SH AUTHOR +This manual page was written by Hayao Nakahara , +for the Debian GNU/Linux system (but may be used by others). --- xjdic-24.orig/debian/postinst +++ xjdic-24/debian/postinst @@ -0,0 +1,47 @@ +#! /bin/sh +# postinst script for xjdic +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + xjdicconfig + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- xjdic-24.orig/debian/compat +++ xjdic-24/debian/compat @@ -0,0 +1 @@ +5 --- xjdic-24.orig/debian/README.Debian +++ xjdic-24/debian/README.Debian @@ -0,0 +1,30 @@ +xjdic for Debian +---------------------- + +* There are 3 versions of kjdic program + + stand-alone type: xjdic_sa + client type: xjdic_cl + server type: xjserver + + xjdic is an alias for xjdic_sa. + +* The default directory of dictionaries in edict formats is + /usr/share/edict + and one for index files is + /var/lib/xjdic. + +* Index files are generated at installing time. + +* When some dictionary is updated, you can remake its index file by + + /usr/sbin/xjdicconfig DICTIONARY_NAME + +* or rebuild all index files by + + /usr/sbin/xjdicconfig + +* /usr/share/doc/xjdic/dot.xjdicrc is a sample ~/.xjdicrc file + (configuration file). + + -- Hayao Nakahara , Tue, 19 Oct 1999 01:18:34 +0900 --- xjdic-24.orig/debian/.xjdicrc.skel +++ xjdic-24/debian/.xjdicrc.skel @@ -0,0 +1,34 @@ +# +# Sample .xjdicrc file +# +# (remove comments from lines below if you want to activate the +# option) +# +# server (default is localhost) +# server daneel.dgs.monash.edu.au +dicdir /home/jwb/nihongo/dics +kdicfile kanjidic_b +# note that I use "kanjidic_b", because I have joined the kanjidic & +# kanjd212 files +# dicfile (default is edict alone) +dicfile edict +dicfile jddict +dicfile compdic +#dicfile enamdict +# kdnosho (no default) +kdnoshow YELUQMKZ +# filt (no defaults) +# +# I don't use these filters, now that names have been moved +# to the ENAMDICT file +#filt 0 2 off "Exclude proper names" (pl, (pn pl) pn) +#filt 1 1 off "Exclude all place names" (pl, pl) +#filt 2 1 off "Exclude all person names" (pn pn) +#filt 3 0 off "Show only person names" (pn pn) +#filt 4 0 off "Show only place names" (pl, pl) +#filt 5 0 off "Show only place & person names" (pl, (pn pl) pn) +# extfile (default is edictext) +#extfile edictexx +# exlist (no default excluded words for xjdxgen) +exlist abbr col vul vulg then and conj int pron pref suf syn ant from +exlist adv adj hon hum pol jap japanese --- xjdic-24.orig/debian/copyright +++ xjdic-24/debian/copyright @@ -0,0 +1,21 @@ +This package was debianized by Hayao Nakahara on +Tue, 19 Oct 1999 01:18:34 +0900. + +It was downloaded from ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic23.tar.gz + +Upstream Author: Jim Breen + +Copyright: + +Copyright: J.W. Breen - 2003 + +The source code and documentation of XJDIC are hereby released under the +terms of the GNU General Public License (GPL). All usage of this program is +at the user's risk, and there is no warranty on its performance. Copies may +be distributed by any means which conforms to the terms of the GPL. + +On Debian GNU/Linux systems you can find a cpoy of the GPL in +/usr/share/common-licenses/GPL. + +XJDIC heavily depends edict package which is in non-free, so XJDIC is +in a contrib part in Debian. --- xjdic-24.orig/debian/xjdicconfig +++ xjdic-24/debian/xjdicconfig @@ -0,0 +1,30 @@ +#!/bin/sh + +DICTS="compdic edict enamdict findic geodic kanjidic lifscdic lingdic \ +j_places engscidic jddicy mktdic finmtkdic panpdic aviation concrete \ +lawdic stardic" + +DICTS212="edicth kanjd212" +DICDIR=/var/lib/xjdic +EDICT=/usr/share/edict + +case $# in +0) +;; +*) DICTS=$@ +;; +esac + +cd $DICDIR +for d in $DICTS +do + rm -f $d $d.xjdx + if [ -f $EDICT/$d ]; then + ln -sf $EDICT/$d . + elif [ -f $EDICT/$d.gz ]; then + zcat $EDICT/$d.gz > $d + else + continue + fi + xjdxgen $d +done