File ami.spec of Package ami

#
# spec file for package ami (Version 1.2.3)
#
# 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

Name:           ami
BuildRequires:  esound-devel gdk-pixbuf-devel update-desktop-files
%if %suse_version > 1010
%define __x11prefix /usr
%define __gnomeprefix /usr
%define	sysconfdir /etc
%else
%define __x11prefix /usr/X11R6
%define __gnomeprefix /opt/gnome
%define	sysconfdir /etc%{__gnomeprefix}
%endif
License:        GNU General Public License (GPL)
Group:          System/I18n/Korean
Provides:       korean-xim
Provides:       locale(xorg-x11:ko)
Requires:       gdk-pixbuf
Autoreqprov:    on
Summary:        Korean IMS (Input Method System) Ami
Version:        1.2.3
Release:        145
URL:            http://kldp.net/projects/ami
Source0:        http://kldp.net/download.php/942/ami-1.2.3.tar.bz2
Source1:        http://www.kr.freebsd.org/~hwang/ami/hanja.dic
Source3:        ami.kdelnk
Source4:        ami.desktop.ko
Source5:        ami_applet.desktop.ko
Source6:        ami.gtkrc.ko
Source7:        ami.desktop.kde3x
Source8:        keyboard-16x16.png
Source9:        keyboard-32x32.png
Source10:       keyboard-16x16.xpm
Source11:       keyboard-32x32.xpm
Source12:       http://adam.kaist.ac.kr/~cwryu/archive/misc/hanja-words-19991020.tar.gz
Source20:       etc-x11-xim.d-ami
Patch2:         ami-makefiles.patch
Patch3:         ami-default-fonts.patch
Patch4:         ami-conf.c.patch
Patch7:         destroy-hanja-dialog.patch
Patch8:         destroywin-2.patch
Patch10:        shift-ctrl-endian-problem.patch
Patch11:        suse-bugzilla-46985-ami-hangs-in-utf8.patch
Patch12:        bugzilla-66166-ami-feedback.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Korean IMS (Input Method System) Ami. Ami uses GTK+ and supports the
Window Maker dock mode.



Authors:
--------
    Nam SungHyun <namsh@kldp.net>
    Jungshik Shin <jshin@kldp.net>
    <cdhwang@sr.hei.co.kr>

%package -n   amidic
Summary:        A Hanja Dictionary for Ami, a Korean IMS
Group:          System/I18n/Korean
Prereq:         /bin/rm /bin/ln
Requires:       ami
Provides:       ami-dic
Provides:       locale(ami:ko)

%description -n amidic
A Hanja dictionary for Ami, a Korean IMS by Changwoo Ryu.

Ami uses GTK+ and supports both the GNOME applet mode and the Window
Maker dock mode.



Authors:
--------
    Changwoo Ryu <cwryu@debian.org>

%prep
%setup -q
%patch2 -p 1 -b .makefiles
%patch3 -p 1 -b .default-fonts
%patch4 -p 1 -b .conf
%patch7 -p 1 -b .destroy-hanja-dialog
%patch8 -p 1 -b .destroywin-2
%patch10 -p1 -b .shift-ctrl-endian-problem
%patch11 -p1 -b .suse-bugzilla-46985-ami-hangs-in-utf8
%patch12 -p1
tar zxvf $RPM_SOURCE_DIR/hanja-words-19991020.tar.gz

%build
# update config.{guess,sub}
%{?suse_update_config}
# export CFLAGS="$RPM_OPT_FLAGS" 
# ./configure --prefix=%{__gnomeprefix} \
# 	    --sysconfdir=%sysconfdir \
# 	    --with-hangul-keyboard=2bul \
# 	    --with-gnome=/opt/gnome \
# 	    --enable-gnome-applet \
# 	    %{_target_cpu}-suse-linux-gnu
# make
# cp src/ami src/ami_applet
# make clean
export CFLAGS="$RPM_OPT_FLAGS"
# export CFLAGS="-g -O0"
./configure --prefix=%{__gnomeprefix} \
 	    --sysconfdir=%sysconfdir \
	    --with-hangul-keyboard=2bul \
	    --with-gnome=%{__gnomeprefix} \
	    %{_target_cpu}-suse-linux-gnu
make
cd hanja-words-19991020
make
cd ../hanjadic
make clean
make
cd ..

%install
make DESTDIR=$RPM_BUILD_ROOT install
# install -s -m 755 src/ami_applet $RPM_BUILD_ROOT/%{__gnomeprefix}/bin
mkdir -p %{buildroot}%{sysconfdir}/CORBA/servers
install -c -m 644 ami.gnorba %{buildroot}%{sysconfdir}/CORBA/servers
##########################################################################
# AMI DIC FILE............................................................
##########################################################################
install -c -m 644 hanja-words-19991020/output/ami.dic \
	%{buildroot}%{__gnomeprefix}/share/ami/cwryu.dic
install -c -m 644 $RPM_SOURCE_DIR/hanja.dic %{buildroot}%{__gnomeprefix}/share/ami/default.dic
ln -s default.dic %{buildroot}%{__gnomeprefix}/share/ami/hanja.dic
##########################################################################
# PIXMAPS.................................................................
##########################################################################
mkdir -p %{buildroot}%{__x11prefix}/share/icons/png/locolor/16x16/apps
mkdir -p %{buildroot}%{__x11prefix}/share/icons/png/hicolor/32x32/apps
mkdir -p %{buildroot}/opt/kde3/share/icons/locolor/16x16/apps
mkdir -p %{buildroot}/opt/kde3/share/icons/hicolor/32x32/apps
mkdir -p %{buildroot}%{__gnomeprefix}/share/pixmaps/
install -c -m 644 $RPM_SOURCE_DIR/keyboard-16x16.png \
	%{buildroot}%{__x11prefix}/share/icons/png/locolor/16x16/apps/ami.png
install -c -m 644 $RPM_SOURCE_DIR/keyboard-32x32.png \
	%{buildroot}%{__x11prefix}/share/icons/png/hicolor/32x32/apps/ami.png
ln -s %{__x11prefix}/share/icons/png/locolor/16x16/apps/ami.png \
	%{buildroot}/opt/kde3/share/icons/locolor/16x16/apps/ami.png
ln -s %{__x11prefix}/share/icons/png/hicolor/32x32/apps/ami.png \
	%{buildroot}/opt/kde3/share/icons/hicolor/32x32/apps/ami.png
ln -s %{__x11prefix}/share/icons/png/hicolor/32x32/apps/ami.png \
	%{buildroot}%{__gnomeprefix}/share/pixmaps/ami.png
##########################################################################
# Menu Entry
##########################################################################
mkdir -p %{buildroot}/usr/share/applications/
install -c -m 644 $RPM_SOURCE_DIR/ami.desktop.kde3x \
	%{buildroot}/usr/share/applications/ami.desktop
%suse_update_desktop_file ami Utility DesktopSettings
%{find_lang} ami
##########################################################################
# GNOME1, we have no use for it ..........................................
##########################################################################
rm %{buildroot}%{sysconfdir}/CORBA/servers/ami.gnorba
mkdir -p $RPM_BUILD_ROOT/etc/X11/xim.d/ko
install -m 644 $RPM_SOURCE_DIR/etc-x11-xim.d-ami \
               $RPM_BUILD_ROOT/etc/X11/xim.d/ami
pushd $RPM_BUILD_ROOT/etc/X11/xim.d/
    ln -s ami Ami
popd	       
pushd  $RPM_BUILD_ROOT/etc/X11/xim.d/ko
    ln -s ../ami 90-ami
popd

%post -n amidic
rm -f %{__gnomeprefix}/share/ami/hanja.dic
ln -s cwryu.dic %{__gnomeprefix}/share/ami/hanja.dic

%postun -n amidic
rm -f %{__gnomeprefix}/share/ami/hanja.dic
ln -s default.dic %{__gnomeprefix}/share/ami/hanja.dic

%clean
rm -rf $RPM_BUILD_ROOT;

%files -f ami.lang
%defattr(-,root,root)
%doc README COPYING ChangeLog AUTHORS THANKS
%dir /etc/X11/xim.d/
/etc/X11/xim.d/*
%{__gnomeprefix}/bin/wmami
%{__gnomeprefix}/bin/ami
%{__gnomeprefix}/bin/hanja_hwp2ami
%dir %{__gnomeprefix}/share/ami/
%{__gnomeprefix}/share/ami/default.dic
%{__gnomeprefix}/share/ami/hanja.dic
%{__gnomeprefix}/share/ami/pix/
%{__gnomeprefix}/share/hangul_keyboard/
%config %{__gnomeprefix}/share/ami/gtkrc
%{__gnomeprefix}/share/pixmaps/ami.png
%dir %{__x11prefix}/share/icons/png/
%dir %{__x11prefix}/share/icons/png/locolor/
%dir %{__x11prefix}/share/icons/png/locolor/16x16/
%dir %{__x11prefix}/share/icons/png/locolor/16x16/apps/
%dir %{__x11prefix}/share/icons/png/hicolor/
%dir %{__x11prefix}/share/icons/png/hicolor/32x32/
%dir %{__x11prefix}/share/icons/png/hicolor/32x32/apps/
%{__x11prefix}/share/icons/png/locolor/16x16/apps/ami.png
%{__x11prefix}/share/icons/png/hicolor/32x32/apps/ami.png
%dir /opt/kde3/
%dir /opt/kde3/share/
%dir /opt/kde3/share/icons/
%dir /opt/kde3/share/icons/locolor/
%dir /opt/kde3/share/icons/locolor/16x16/
%dir /opt/kde3/share/icons/locolor/16x16/apps/
%dir /opt/kde3/share/icons/hicolor/
%dir /opt/kde3/share/icons/hicolor/32x32/
%dir /opt/kde3/share/icons/hicolor/32x32/apps/
/opt/kde3/share/icons/locolor/16x16/apps/ami.png
/opt/kde3/share/icons/hicolor/32x32/apps/ami.png
/usr/share/applications/ami.desktop

%files -n amidic
%defattr(-,root,root)
%{__gnomeprefix}/share/ami/cwryu.dic

%changelog -n ami
* Fri Jan 26 2007 - ro@suse.de
- and GNOME has moved to /usr
* Thu Jan 25 2007 - sndirsch@suse.de
- move from /usr/X11R6 to /usr
* Tue Feb 28 2006 - mfabian@suse.de
- add "Provides: locale(xorg-x11:ko)" to main package and
  "Provides: locale(ami:ko)" to amidic sub-package.
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Dec 21 2005 - ro@suse.de
- include icon in filelist
* Thu Apr 21 2005 - mfabian@suse.de
- Bug #66166 - LTC14042-Korean IM (ami) returns incorrect feedback
  value:
  apply patch supplied by ksampei@jp.ibm.com.
* Thu Apr 14 2005 - sbrabec@suse.cz
- Added audiofile-devel to neededforbuild.
* Fri Feb 25 2005 - adrian@suse.de
- install menu entry to global directory,
- call %%suse_update_desktop_file
- move entry to DesktopSettings menu
* Tue Feb 22 2005 - mfabian@suse.de
- create start script /etc/X11/xim.d/nabi and symlink in ko
  subdirectory.
* Wed Nov 10 2004 - ro@suse.de
- reduced neededforbuild
* Fri Oct 15 2004 - mfabian@suse.de
- Bugzilla #46985: "LTC11660-Ami (Korean IM) hangs up on UTF-8
  locale". Patch suse-bugzilla-46985-ami-hangs-in-utf8.patch
  supplied by <takiguc@jp.ibm.com> fixes this problem.
* Fri May 28 2004 - mfabian@suse.de
- Bugzilla 40452: "LTC8294-Korea: AMI IM caused Seg fault after
  destroying one of some TextFields": apply fix supplied
  by Mitsuru CHINEN <mchinen@yamato.ibm.com>.
* Tue Mar 16 2004 - sbrabec@suse.cz
- GNOME skeleton directories excluded from %%files.
- Removed amignome - relicts of GNOME1 applet.
* Fri Jan 30 2004 - mfabian@suse.de
- update to 1.2.3
- remove ami-64bit.patch, ami-kde-detection-bigendian.patch,
  incompatible-pointer-type-warnings.patch, chartable.c.patch
  (included upstream).
* Thu Jan 29 2004 - mfabian@suse.de
- add shift-ctrl-endian-problem.patch, see Bugzilla #32149.
  Patch thanks to Mitsuru CHINEN <mchinen@yamato.ibm.com>.
* Tue Jan 20 2004 - mfabian@suse.de
- add destroy-hanja-dialog.patch to fix segfault after some
  operations for the candidate window (see Bugzilla #32272).
- add incompatible-pointer-type-warnings.patch which makes Ami
  work on x86_64.
- acc chartable.c.patch to fix more crashes after select operations
  in the candidate window (without that patch Ami crashes if one
  types "dlf [F9] Space".
* Sat Jan 10 2004 - adrian@suse.de
- build as user
* Mon Jun 30 2003 - ro@suse.de
- remove directories already in other gnome packages
- use gnome-devel-packages in neededforbuild
* Sun Jun 15 2003 - mfabian@suse.de
- remove directories already in filesystem rpm from file list
- use %%{find_lang}
* Wed Jun 11 2003 - mfabian@suse.de
- fix the rest of Bugzilla #26766: make it work with mlterm on
  64bit architectures. Thanks again to Mitsuru Chinen.
- avoid "directories not owned by any package" errors from
  autobuild.
* Tue May 27 2003 - mfabian@suse.de
- update to 1.2.2
- remove utf-8 patch, now included in released version
- clean up .spec file a bit and also install keyboard maps
  and new themes
- ami-64bit.patch: Bugzilla #27181: fix endianness problem
  to make ami detect KDE correctly.
- ami-kde-detection-bigendian.patch: Bugzilla #26766:
  fix from Mitsuru Chinen for 64bit architectures.
* Mon Feb 03 2003 - mfabian@suse.de
- add utf-8 patch by Jungshik Shin <jshin@mailaps.org> (see also
  http://mail.nl.linux.org/linux-utf8/2002-04/msg00147.html)
  (includes patch for multiline string issue)
  This patch makes it possible to enter Hangul syllables which are
  included in Unicode but are not included in KS X 1001 repertoire.
  For example U+AC02. U+AC02 can be typed as the keysequence
  'r', 'k', 'R' (on a qwerty KBD).
* Mon Jan 27 2003 - mfabian@suse.de
- Bug #20647: change default configuration to
  "One character Input (korean unit)" as a workaround for
  using Ami with Qt3.
* Mon Jan 20 2003 - ro@suse.de
- fix multiline string issue in code
* Thu Oct 10 2002 - mfabian@suse.de
- update to 1.0.11
- add ami-1.0.11-fix-qt_input.patch
* Fri Sep 27 2002 - ro@suse.de
- Added alsa alsa-devel to neededforbuild (esound)
* Fri Aug 16 2002 - mfabian@suse.de
- mv Prereq: to amidic sub-package
- remove stuff for KDE1
- move stuff from /opt/kde2 to /opt/kde3
- temporarily disable build of gnome applet.
  (gnome-applets.rpm was dropped, therefore we can't build the
  gnome-applet currently. Will probably become available again
  when the transition to Gnome2 is finished)
- some .spec-file cleanup
* Thu Aug 01 2002 - mfabian@suse.de
- add  Prereq: /bin/ln /bin/rm
* Fri Feb 08 2002 - mfabian@suse.de
- add --with-gnome=/opt/gnome to make it build again
* Tue Dec 04 2001 - mfabian@suse.de
- use a different default font, '-schumacher-clean-medium-*'
  doesn't seem to exist anymore
- bzip2 source
* Mon Apr 16 2001 - violiet@suse.de
- update to 1.0.10
* Sun Feb 04 2001 - violiet@suse.de
- fixed KDE1 pixmap.
* Wed Jan 03 2001 - violiet@susekorea.net
- NEW AMI PIXMAPS....
- modified KDE-1.x, KDE-2.x desktop file.
- amignome provides correct: XIM -> korean-xim.
- NEW amidic package.
- NEW SPEC.
* Mon Dec 11 2000 - violiet@susekorea.net
- update to 1.0.8
- added neededforbuild: gdk-pixbuf, gdk-pixbuf-devel
* Fri Nov 24 2000 - violiet@susekorea.net
- update to 1.0.7.1
- kde2 converted support ami desktop.
* Sun Nov 19 2000 - mfabian@suse.de
- fixed directory structure: gnome stuff should
  go to /opt/gnome
* Tue Nov 07 2000 - kukuk@suse.de
- add esound-devel to neededforbuild
* Mon Nov 06 2000 - ro@suse.de
- fixed neededforbuild
* Wed Aug 23 2000 - mfabian@suse.de
- adapted to SuSE autobuild
* Sun Oct 31 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 1.0.1
* Mon Oct 25 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- new glibc environment rebuild.
* Tue Oct 19 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- Accel Linux 6.1 build release.
* Sun Oct 10 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 1.0.0
* Fri Oct 08 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 0.5.4
* Sat Oct 02 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 0.5.3
* Tue Sep 28 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 0.5.1
* Fri Aug 27 1999 - Sang-Jin Hwang, <accel@accellinux.org>
- update to 0.4.1
* Wed Aug 18 1999 - Sang-Jin Hwang, <accel@linux.accellinux.org>
- add dvorak keyboard patch.
- keyboard environment variable patch of cdhwang
* Fri Aug 13 1999 - Sang-Jin Hwang, <accel@linux.mdworld.com>
- initial package
openSUSE Build Service is sponsored by