%define name xiterm+thai
%define version @VERSION@
%define release 1
%define manifest %{_builddir}/%{name}-%{version}-%{release}.manifest

Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL
Group: Extensions/Thai
Source0: %{name}-%{version}.tar.gz
#Source1: txiterm
#Source2: txiterm.desktop
#Source3: Txiterm.kdelnk
BuildRoot: /var/tmp/%{name}-%{version}-root
URL: http://linux.thai.net/linux-tle/
Distribution: Thai Linux Working Group
Vendor: Modified by Vuthichai Ampornaramvech <vuthi@venus.dti.ne.jp>
Packager: Theppitak Karoonboonyanan <thep@links.nectec.or.th>
Requires: thaixfonts >= 1.1-3, XFree86 >= 4.3.0
Summary: xiterm with Thai patch


%description
This package was modified from xiterm to use Thai language with xterm. 
You can switch to Thai keyboard by pressing Ctrl+Space or F1. 
Using Thai X terminal with command "txiterm".

%prep
%setup

%build
./configure --prefix=/usr
make


%install
mkdir -p $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

#install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/%{SOURCE1}
## mHom: install menu.
#install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/gnome/apps/Utilities/txiterm.desktop
#install -D -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/skel/Desktop/Txiterm.kdelnk

# __os_install_post is implicitly expanded after the
# install section... do it now, and then disable it,
# so all work is done before building manifest.

%{?__os_install_post}
%define __os_install_post %{nil}

# build the file list automagically into %{manifest}

cd $RPM_BUILD_ROOT
rm -f %{manifest}
find . -type d \
        | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' >> %{manifest}
find . -type f \
        | sed 's,^\.,\%attr(-\,root\,root) ,' >> %{manifest}
find . -type l \
        | sed 's,^\.,\%attr(-\,root\,root) ,' >> %{manifest}


%clean
rm -fr $RPM_BUILD_DIR/%{name}-%{version}
rm -fr $RPM_BUILD_ROOT/%{name}-%{version}-root


%files -f %{manifest}
#%doc README
#%doc README.thai

%changelog
* Thu Mar 13 2003 Theppitak Karoonboonyanan <thep@linux.thai.net>
- comment out sources that are not included in source tarball

* Sat Mar 01 2003 Theppitak Karoonboonyanan <thep@linux.thai.net>
- requires XFree86 >= 4.3.0, according to last change in string conversion
  callback support

* Tue Jan 14 2003 Theppitak Karoonboonyanan <thep@linux.thai.net>
- fix "%install" mess in comment (rpmbuild's oddity)

* Tue Nov 27 2001 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- use %{name}, %{version}, %{release} variables
- rename spec to xiterm+thai.spec.in
- use manifest
- release version 1.04

* Fri Jan 19 2001 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- fix path for xiterm in txiterm script (Thnx: Pattara Kiatisevi)
- fix install script for GNOME menu installation (Thnx: Sadit Sathianpaisarn)
- add %clean script to clear RPM_BUILD_ROOT (Thnx: Sadit Sathianpaisarn)
- add KDE link (Thnx: Sadit Sathianpaisarn)

* Mon Jan 01 2001 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- xiterm+thai.spec : use variables for sources, path names; use BuildRoot
- xiterm+thai.spec : use /usr prefix instead of /usr/local
- release version 1.04pre1

* Sat Nov 18 2000 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- src/command.c : Add XSetICFocus() to force initialization of Input_Context
  which is necessary for XIM tasks.
- src/command.c, src/xdefaults.c : Add -tim option (thai_im resource) for
  specifying Thai XIM mode.
	  
* Thu Nov 09 2000 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- add setlocale() as per Lucy's contribution to support new Thai XKB map
  of XFree86 4.0.1 which conforms to <X11/keysymdef.h>
- release version 1.03

* Tue Jul 06 1999 Pattara Kiatisevi <ott@nectec.or.th>
- modify "txiterm" shell script to pass arguments to "xiterm" if any.

* Thu Jul 01 1999 Poonlap Veerathanabutr <poon-v@fedu.uec.ac.jp>
- re-write spec file
- create shell script for txiterm
- use nectec18 font

