File xjdic.spec of Package xjdic

#
# spec file for package xjdic
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           xjdic
Version:        2.4
Release:        0
Summary:        Japanese-English Dictionary Interface
License:        GPL-2.0-or-later
Group:          System/I18n/Japanese
URL:            https://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
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
Patch7:         xjdic-Kstrcmp.patch
Patch8:		xjdic-2.4-implicit-funtion-declaration.patch
Patch9:		xjdic-2.4-implicit-int.patch
Patch10:	xjdic-2.4-gcc15.patch
BuildRequires:  edict
Requires:       edict
Requires:       xjdic-data
Requires:       xjdic-indices

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

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

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

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

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

%prep
%setup -q -T -n %{name}-%{version} -c %{name}-%{version} -a 0
%patch -P 0 -p 1
%patch -P 1 -p 1
%patch -P 2 -p 1
%patch -P 3 -p 1
%patch -P 4 -p 0
%patch -P 5 -p 1
%patch -P 6 -p 1
%patch -P 7 -p 1
%patch -P 8 -p 1
%patch -P 9 -p 1
%patch -P 10 -p 1
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
bunzip2 *html.bz2
cp gnu_licence COPYING

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

%install
mkdir -p %{buildroot}{%{_datadir}/edict,%{_prefix}/bin,%{_mandir}/man1}
install -m 755 xjdic_sa %{buildroot}%{_bindir}
ln -s xjdic_sa %{buildroot}%{_bindir}/xjdic
install -m 755 xjdxgen %{buildroot}%{_bindir}
install -m 755 xjdrad %{buildroot}%{_bindir}
# Scripts to generate EUC-JP encoded versions of the UTF-8 encoded dictionaries
# from edict.rpm and to generate indices:
install -m 755 %{SOURCE5} %{buildroot}%{_bindir}
# install data files and man pages:
install -m 644 radicals.tm vconj kanjstroke radkfile romkana.cnv gnu_licence \
               %{buildroot}%{_datadir}/edict
install -m 644 xjdic.1 %{buildroot}%{_mandir}/man1/xjdic.1
gzip --best %{buildroot}%{_mandir}/man1/xjdic.1
# install diacritics file:
install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/edict

%files -n xjdic
%license COPYING
%doc xjdic*.WHATSNEW xjdic*.inf xjdic*.install *html suse.xjdicrc .xjdicrc.skel
%{_mandir}/man?/*
%{_bindir}/xjdic
%{_bindir}/xjdic_sa
%{_bindir}/xjdrad
%{_bindir}/xjdxgen

%files -n xjdic-data
%dir %{_datadir}/edict/
%{_datadir}/edict/gnu_licence
%{_datadir}/edict/radicals.tm
%{_datadir}/edict/vconj
%{_datadir}/edict/kanjstroke
%{_datadir}/edict/radkfile
%{_datadir}/edict/romkana.cnv
%{_datadir}/edict/diacritics

%files -n xjdic-indices
%{_bindir}/xjdic-utf-8-to-euc-jp

%changelog
openSUSE Build Service is sponsored by