File xjdic.spec of Package xjdic

# spec file for package xjdic (Version 2.4)
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           xjdic
BuildRequires:  edict
License:        GPL v2 or later
Group:          System/I18n/Japanese
Requires:       edict, xjdic-data, xjdic-indices
AutoReqProv:    on
Version:        2.4
Release:        236
# Original source:
# Original source
# Original source
Source3:        suse.xjdicrc
Source4:        SuSEconfig.xjdic
Source5:        xjdic-utf-8-to-euc-jp
Source6:        diacritics
Patch0:         diacritics.patch
Patch1:         resplen.patch
Patch2:         xjdic.patch
Patch3:         xjdic-powerpc.patch
Patch4:         xjdic-2.4-nonvoid.patch
Patch5:         fix-implicit-declarations.patch
Patch6:         bugzilla-158071-local-variable-not-initialized.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Japanese-English Dictionary Interface

XJDIC is an electronic Japanese-English dictionary program designed to
operate a Japanese capable terminal: "kterm" under the X Window System,
for example.

It is based on JDIC and JREADER which were developed to run under
MS-DOS on IBM PCs or clones.

XJDIC functions as:

1. 1. an English to Japanese dictionary (eiwa jiten).

1. 2. a Japanese to English dictionary (waei jiten).

1. 3. a Japanese-English Character dictionary (kanei jiten), capable of
selecting Kanji characters by JIS code, radical, stroke count, Nelson
Index number, or reading, and displaying compounds containing that

    Jim Breen <>

%package -n xjdic-data
License:        GPL v2 or later
Summary:        Data Files Needed by XJDIC and Gjiten
Group:          System/I18n/Japanese

%description -n xjdic-data
This packages contains several data files needed by XJDIC and Gjiten.
XJDIC and Gjiten are programs used to access the Japanese-English EDICT

    Jim Breen  <>

%package -n xjdic-indices
License:        GPL v2 or later
Summary:        EDICT Index Files Needed by XJDIC and Gjiten
Group:          System/I18n/Japanese

%description -n xjdic-indices
This package contains index files for the Japanese-English EDICT
dictionaries. These index files are necessary to run XJDIC or Gjiten,
which can be used to access EDICT.

    Jim Breen  <>

%setup0 -q -T -n %{name}-%{version} -c %{name}-%{version} -a 0
%patch0 -p 1
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1 
%patch5 -p 1
%patch6 -p 1
cp $RPM_SOURCE_DIR/*html.bz2 .
bunzip2 *html.bz2
cp $RPM_SOURCE_DIR/suse.xjdicrc .
cp gnu_licence COPYING

CC="gcc $CFLAGS" make -e stand xjdxgen
gcc $CFLAGS xjdrad.c -o xjdrad

[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p $RPM_BUILD_ROOT{/usr/share/edict,/usr/bin,%{_mandir}/man1}
install -m 755 xjdic_sa $RPM_BUILD_ROOT/usr/bin
ln -s xjdic_sa $RPM_BUILD_ROOT/usr/bin/xjdic
install -m 755 xjdxgen $RPM_BUILD_ROOT/usr/bin
install -m 755 xjdrad $RPM_BUILD_ROOT/usr/bin
# Scripts to generate EUC-JP encoded versions of the UTF-8 encoded dictionaries
# from edict.rpm and to generate indices:
install -m 755 $RPM_SOURCE_DIR/xjdic-utf-8-to-euc-jp $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d/
install -m 755 $RPM_SOURCE_DIR/SuSEconfig.xjdic $RPM_BUILD_ROOT/sbin/conf.d/
# install data files and man pages:
install -m 644 vconj kanjstroke radkfile romkana.cnv gnu_licence \
install -m 644 xjdic.1 $RPM_BUILD_ROOT%{_mandir}/man1/xjdic.1
gzip --best $RPM_BUILD_ROOT%{_mandir}/man1/xjdic.1
# install diacritics file:
install -m 644 $RPM_SOURCE_DIR/diacritics $RPM_BUILD_ROOT/usr/share/edict

#[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;

%files -n xjdic
%defattr(-, root, root)
%doc COPYING xjdic*.WHATSNEW xjdic*.inf xjdic*.install *html suse.xjdicrc .xjdicrc.skel
%doc %{_mandir}/man?/*

%files -n xjdic-data
%defattr(-, root, root)
%dir /usr/share/edict/

%files -n xjdic-indices
%defattr(-, root, root)

* Thu Apr 16 2009
- buildfix: refresh patches
* Wed Jan 17 2007
- Bugzilla #219048: initialize local variable before use
* Wed Mar 15 2006
- Bugzilla #158071: initialize local variable before use.
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Thu Sep 22 2005
- fix implicit declarations.
* Wed May 19 2004
- added return value to non-void function
* Sun Jan 11 2004
- add %%defattr
* Thu Sep 18 2003
- Bugzilla #31299:
  fix problem with long entry lines in wadokujt (patch from
  the author, Jim Breen).
* Mon Sep 15 2003
- make entering of German umlauts and other diacritics possible.
  (Fixed by a patch received from the author Jim Breen).
* Mon Sep 08 2003
- xjdic works in EUC-JP only and this is difficult to fix at
  the moment. As a workaround, extend SuSEconfig.xjdic to generate
  EUC-JP encoded versions of the UTF-8 encoded dictionaries in
- adapt sample rc-file "suse.xjdicrc" accordingly.
* Mon Aug 25 2003
- update to 2.4.
* Sat Jun 14 2003
- fix "directory is not owned by any package".
* Sun Feb 16 2003
- add "buddhdic" to the list of dictionaries in SuSEconfig.xjdic
* Sat Feb 15 2003
- add "wadokujt" to the list of dictionaries in SuSEconfig.xjdic
* Mon Mar 18 2002
- add 'stardict ediclsd3 engscidic lawgledt' to DICTS list
  in SuSEconfig.xjdic script
* Wed Jan 23 2002
- add 'gdict' to DICTS list in SuSEconfig.xjdic script
* Sun Nov 04 2001
- fix bug in SuSEconfig.xjdic script
* Sat Nov 03 2001
- don't pack the generated indices into the subpackage
  xjdic-indices, only pack a SuSEconfig.xjdic script instead which
  will generate the indices. This has 2 advantages:
  - saves about 6 MB in the xjdic-indices.rpm
  - indices will be automatically regenerated if newer versions
  of the EDICT dictionaries are installed.
* Thu Sep 06 2001
- some more portability fixes. Does not only build on ia64 now
  but even works.
- make it work on PowerPC as well
* Tue Sep 04 2001
- Fix portability.
* Mon Sep 03 2001
- new package: xjdic, version 2.3