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 http://bugs.opensuse.org/
#

# 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
Url:            http://www.csse.monash.edu.au/~jwb/xjdic/
# Original source: ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic24.tgz
Source0:        ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic24.tar.bz2
# Original source ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic23_inf.html
Source1:        ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic23_inf.html.bz2
# Original source ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic23_install.html
Source2:        ftp://ftp.cc.monash.edu.au/pub/nihongo/xjdic23_install.html.bz2
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

%description
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
Kanji.



Authors:
--------
    Jim Breen <j.breen@csse.monash.edu.au>

%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
dictionaries.



Authors:
--------
    Jim Breen  <j.breen@csse.monash.edu.au>

%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.



Authors:
--------
    Jim Breen  <j.breen@csse.monash.edu.au>

%prep
%setup0 -q -T -n %{name}-%{version} -c %{name}-%{version} -a 0
%patch0 -p 1
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1 
%patch4
%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

%build
export CFLAGS="$RPM_OPT_FLAGS"
CC="gcc $CFLAGS" make -e stand xjdxgen
gcc $CFLAGS xjdrad.c -o xjdrad

%install
[ "$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 radicals.tm vconj kanjstroke radkfile romkana.cnv gnu_licence \
               $RPM_BUILD_ROOT/usr/share/edict
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

%clean
#[ "$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?/*
/usr/bin/xjdic
/usr/bin/xjdic_sa
/usr/bin/xjdrad
/usr/bin/xjdxgen

%files -n xjdic-data
%defattr(-, root, root)
%dir /usr/share/edict/
/usr/share/edict/gnu_licence
/usr/share/edict/radicals.tm
/usr/share/edict/vconj
/usr/share/edict/kanjstroke
/usr/share/edict/radkfile
/usr/share/edict/romkana.cnv
/usr/share/edict/diacritics

%files -n xjdic-indices
%defattr(-, root, root)
/usr/bin/xjdic-utf-8-to-euc-jp
/sbin/conf.d/SuSEconfig.xjdic

%changelog
* Thu Apr 16 2009 ro@suse.de
- buildfix: refresh patches
* Wed Jan 17 2007 mfabian@suse.de
- Bugzilla #219048: initialize local variable before use
* Wed Mar 15 2006 mfabian@suse.de
- Bugzilla #158071: initialize local variable before use.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Sep 22 2005 mfabian@suse.de
- fix implicit declarations.
* Wed May 19 2004 ro@suse.de
- added return value to non-void function
* Sun Jan 11 2004 adrian@suse.de
- add %%defattr
* Thu Sep 18 2003 mfabian@suse.de
- Bugzilla #31299:
  fix problem with long entry lines in wadokujt (patch from
  the author, Jim Breen).
* Mon Sep 15 2003 mfabian@suse.de
- make entering of German umlauts and other diacritics possible.
  (Fixed by a patch received from the author Jim Breen).
* Mon Sep 08 2003 mfabian@suse.de
- 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
  edict.rpm.
- adapt sample rc-file "suse.xjdicrc" accordingly.
* Mon Aug 25 2003 mfabian@suse.de
- update to 2.4.
* Sat Jun 14 2003 mfabian@suse.de
- fix "directory is not owned by any package".
* Sun Feb 16 2003 mfabian@suse.de
- add "buddhdic" to the list of dictionaries in SuSEconfig.xjdic
* Sat Feb 15 2003 mfabian@suse.de
- add "wadokujt" to the list of dictionaries in SuSEconfig.xjdic
* Mon Mar 18 2002 mfabian@suse.de
- add 'stardict ediclsd3 engscidic lawgledt' to DICTS list
  in SuSEconfig.xjdic script
* Wed Jan 23 2002 mfabian@suse.de
- add 'gdict' to DICTS list in SuSEconfig.xjdic script
* Sun Nov 04 2001 mfabian@suse.de
- fix bug in SuSEconfig.xjdic script
* Sat Nov 03 2001 mfabian@suse.de
- 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 mfabian@suse.de
- 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 schwab@suse.de
- Fix portability.
* Mon Sep 03 2001 mfabian@suse.de
- new package: xjdic, version 2.3