File javadict.spec of Package javadict

#
# spec file for package javadict (Version 1.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild
# icecream 0

Name:           javadict
BuildRequires:  edict java2-devel-packages xjdic-indices
License:        GPL v2 or later
Group:          Productivity/Office/Dictionary
Requires:       edict, jre1.1.x, xjdic-indices
Autoreqprov:    on
Version:        1.1
Release:        631
URL:            http://www.cs.arizona.edu/japan/JavaDict/
Source0:        http://www.cs.arizona.edu/japan/JavaDict/download/JavaDict-contest.tar.bz2
Source1:        javadict.sh
Patch0:         javadict-fontsetup.patch
Patch1:         javadict-java.patch
BuildArchitectures: noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Japanese-English Dictionary Lookup Tool Featuring Handwriting Recognition

%description
JavaDict is a Japanese-English dictionary and character dictionary
browser (for Jim Breen's EDICT dictionary) featuring handwriting
recognition-based character lookup.

It is portable, easy to use, and primarily intended for use by
English-speaking students of Japanese (or Japanese-speaking students of
English).



Authors:
--------
    Todd David Rudick <trudick@hotmail.com>

%prep 
%setup -c %{name}-%{version} -n %{name}-%{version}
%patch0 -p1
%patch1 -p0
find . -type d | xargs chmod 755
# clean up precompiled classes
rm *.class

%build
javac -target 1.4 -source 1.4 *.java
mkdir javadict
mv *.class javadict
cat <<EOF > manifest
Manifest-Version: 1.0
Main-Class: javadict/JavaDict
EOF
# sic!, see jar -help
jar -cvfm javadict.jar manifest javadict/*
rm -rf javadict
rm *.java
# fix permissions
chmod a-x *.gif

%install
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
# install startscript:
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/javadict
# install Java stuff:
mkdir -p $RPM_BUILD_ROOT/usr/lib/javadict
cp -a  ./* $RPM_BUILD_ROOT/usr/lib/javadict
# remove docs in installed tree (because they will also be in
# %{_defaultdocdir}/%{packagename}:
for i in COPYING READ.ME README.html docs/
do
    rm -rf $RPM_BUILD_ROOT/$i
done
# make symbolic links to the dictionaries from the "edict" package:
for i in enamdict edict jddict.v02 pandpdic geodic lingdic concrete \
         classical aviation j_places kanjidic compverb mktdic compdic \
         kanjd212 edicth 4jwords findic
do
    test -e /usr/share/edict/$i-euc || continue
    ln -s -f /usr/share/edict/$i-euc $RPM_BUILD_ROOT/usr/lib/javadict/$i
done

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

%files
%defattr(-,root,root)
%doc COPYING READ.ME README.html docs/
/usr/bin/javadict
%dir /usr/lib/javadict/
/usr/lib/javadict/*

%changelog
* Thu Aug 09 2007 - skh@suse.de
- build from source (fixes #227446)
- fix build with java 1.5
* Fri Dec 15 2006 - mfabian@suse.de
- Bugzilla #227445: move javadict from /usr/X11R6/bin to /usr/bin.
- use sazanami fonts instead of kochi fonts in font setup.
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Sun Feb 13 2005 - ro@suse.de
- only create links to existing dicts
* Fri Feb 06 2004 - hmacht@suse.de
- building as non-root (#norootforbuild)
* Mon Sep 08 2003 - mfabian@suse.de
- require "xjdic-indices" and add it to neededforbuild becaue
  javadict can only work with EUC-JP encoded dictionaries and
  needs "xjdic-indices" to generate them from the UTF-8
  encoded dictionaries in edict.rpm.
* Tue Jul 01 2003 - mfabian@suse.de
- use "export LC_ALL=ja_JP.eucJP" in the start script as a
  workaround because javadict doesn't work well in ja_JP.UTF-8.
- patch the font.properties.Unix file to use fonts which work
  on SuSE Linux. This file is not used automatically, but the
  documentation mentions it and recommends to copy it to
  to the /usr/lib/java/lib directory, therefore it should better
  be correct just in case anybody really does this.
* Fri Jun 13 2003 - mfabian@suse.de
- add edict to "# neededforbuild" to be able to create symlinks
  to edict
- fix "directory not owned by any package"
* Sun Jun 30 2002 - ro@suse.de
- fix directory permissions
* Thu Nov 22 2001 - pmladek@suse.cz
- changed Requires from java to more universal jre1.1.x
* Mon May 07 2001 - mfabian@suse.de
- bzip2 source
* Mon Apr 09 2001 - ro@suse.de
- fixed group tag
* Tue Sep 26 2000 - mfabian@suse.de
- new package javadict 1.1
openSUSE Build Service is sponsored by