%define tcl_major	8.4
%define tk_major	8.4
%define thread_major	2.6
%define tix_major	8.4
%define tixversion	%{tix_major}.2
Summary: A Tcl/Tk development environment: tix
Summary(ja): Tcl/Tk 開発環境: tix
Name: tix
Version: %{tixversion}
Release: 1%{?_dist_release}
Group: Development/Languages
License: BSD
URL: http://tix.sourceforge.net/
Source0: Tix%{tixversion}-src.tar.gz
Patch20: tix-8.1.4-perf.patch
Patch22: tix-8.2.0b1-dirtree.patch
BuildRequires: tcl >= %{tcl_major}
BuildRequires: tk >= %{tk_major}
BuildRequires: thread >= %{thread_major}
Requires: tcl >= %{tcl_major}
Requires: tk >= %{tk_major}
Requires: thread >= %{thread_major}
Buildroot: %{_tmppath}/%{name}-%{version}-root

%description -n tix
Tix (Tk Interface Extension), an add-on for the Tk widget set, is an
extensive set of over 40 widgets.  In general, Tix widgets are more
complex and more capable than the widgets provided in Tk.  Tix widgets
include a ComboBox, a Motif-style FileSelectBox, an MS Windows-style
FileSelectBox, a PanedWindow, a NoteBook, a hierarchical list, a
directory tree and a file manager.

Install the tix package if you want to try out more complicated widgets
for Tk.  You'll also need to have the tcl and tk packages installed.

%description -n tix -l ja
Tk ウィジェットセットのためのアドオンである、Tix (Tk Interface Extension)
は 40 ウィジェットを超える拡張セットです。Tix ウィジェットの多くが、
Tk から供給されるウィジェットよりも高機能です。Tix ウィジェットは
コンボボックス、Motif スタイルのファイルボックス、MS Windows スタイルの
ファイルボックス、パネルウィンドウ、ノートブック、階層リスト、
ディレクトリツリー、ファイルマネージャを含んでいます。

Tk で、より複雑ななウィジェットを試したい時には、tix パッケージをインストール
してください。tcl と tk のパッケージもインストールする必要があります。


%prep
%setup -q -n Tix%{tixversion}
%patch20 -p1 -b .perf
%patch22 -p1 -b .dirtree

%build
# make the libraries reentrant
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_REENTRANT"
%configure \
	--with-tcl=%{_libdir} \
	--with-tk=%{_libdir} \
	--enable-shared \
	--enable-threads \

make %{?_smp_mflags} all

%install
rm -rf ${RPM_BUILD_ROOT}
%makeinstall

SOFILE=libTix%{version}.so
mv $RPM_BUILD_ROOT%{_libdir}/Tix%{version}/$SOFILE $RPM_BUILD_ROOT%{_libdir}
ln -sf ../$SOFILE $RPM_BUILD_ROOT%{_libdir}/Tix%{version}/$SOFILE
ln -sf ./$SOFILE $RPM_BUILD_ROOT%{_libdir}/libTix.so
ln -sf ./$SOFILE $RPM_BUILD_ROOT%{_libdir}/libTix%{tix_major}.so
ln -sf ./$SOFILE $RPM_BUILD_ROOT%{_libdir}/libtix.so
ln -sf ./$SOFILE $RPM_BUILD_ROOT%{_libdir}/libtix%{tix_major}.so

install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -d $RPM_BUILD_ROOT%{_mandir}/mann
install -m 644 man/tixwish.1 $RPM_BUILD_ROOT%{_mandir}/man1
install -m 644 man/*.n $RPM_BUILD_ROOT%{_mandir}/mann

install -d $RPM_BUILD_ROOT%{_includedir}
install -m 0644 generic/tix.h $RPM_BUILD_ROOT%{_includedir}/tix.h

## others
SHAREDDIR=$RPM_BUILD_ROOT%{_datadir}/tix-%{version}
install -d $SHAREDDIR/demos/bitmaps
install -d $SHAREDDIR/demos/samples
install -m 755 demos/widget $SHAREDDIR/demos
install -m 644 demos/{*.tcl,tclIndex}  $SHAREDDIR/demos
install -m 644 demos/bitmaps/* $SHAREDDIR/demos/bitmaps
install -m 644 demos/samples/* $SHAREDDIR/demos/samples
cp -a tests $SHAREDDIR

## * old scripts *
## find . -type d -name CVS | xargs -r rm -frv
## echo "%%defattr(-,root,root)" > tix.files
## (find ${RPM_BUILD_ROOT}%{_bindir} \
##         ${RPM_BUILD_ROOT}%{_mandir} -type f -o -type l;
##  find ${RPM_BUILD_ROOT}%{_libdir}/*) | cat - *.files \
##         | sort | uniq -u >> tix.files
## 
## set +x +H
## for n in `cat tix.files`; do
##         test -f $n || continue
##         head -1 $n | grep -q ^#! || continue
##         chmod u+w $n
##         perl -pi -e "s|${RPM_BUILD_ROOT}||" $n
## done
## set -x -H
## 
## #==========================================
## # post process the *.files list, removing build sys references and mark
## # which are directories
## set +x
## for n in *.files; do
##         mv $n $n.in
##         sed "s|.*%{_prefix}\\>|%{_prefix}|" < $n.in | while read file; do
##             if [ -d ${RPM_BUILD_ROOT}/$file ]; then
##                 echo -n '%dir '
##             fi
##             echo $file
##         done > $n
##         rm -f $n.in
## done
## set -x
##
## # Man pages can be compressed
## perl -pi -e 's|(^%{_mandir}/man.*$)|\1\*|' *.files


%post -p /sbin/ldconfig -n tix

%postun -p /sbin/ldconfig -n tix

%clean
rm -rf $RPM_BUILD_ROOT

%files -n tix
%defattr(-,root,root,-)
%doc ChangeLog README.txt man/html man/index.html
%{_libdir}/lib*.so
%{_libdir}/Tix%{version}
%{_datadir}/tix-8.4.2
%{_mandir}/man1/tixwish.1.gz
%{_mandir}/mann/*.n.gz
%{_includedir}/*.h


%changelog
* Sat Jul 26 2008 Shu KONNO <owa@bg.wakwak.com> 8.4.2-1vl5
- applied new versioning policy

* Sun Feb 17 2008 Shu KONNO <owa@bg.wakwak.com> 8.4.2-0vl3
- rebuild with tcl/tk-8.4.18

* Tue Oct 09 2007 Shu KONNO <owa@bg.wakwak.com> 8.4.2-0vl2
- rebuild with tcl/tk-8.4.16

* Wed Jun 13 2007 Shu KONNO <owa@bg.wakwak.com> 8.4.2-0vl1
- updated tix to 8.4.2
- rebuilt with new toolchain

* Sat Jan 28 2006 Shu KONNO <owa@bg.wakwak.com> 8.2.0-0vl5
- rebuild for tcl/tk-8.4.12, and x86_64 architecture support

* Fri Sep 09 2005 Shu KONNO <owa@bg.wakwak.com> 8.2.0-0vl4
- changed url to http://tix.sourceforge.net/download.shtml
- rebuild for tcl/tk-8.4.11

* Wed Jun 30 2004 Shu KONNO <owa@bg.wakwak.com> 8.2.0-0vl3
- rebuild for tcl/tk-8.4.6

* Mon Jan 12 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 8.2.0-0vl2
- rebuild for tcl/tk-8.4.5

* Mon Mar 31 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 8.2.0-0vl1
- update based on BitWalk's tcltk-8.4.2-83bw

* Thu Nov 15 2001 Kazuhusa TAKEI <takei@linux.or.jp> 8.0.5_jp-10vl3
- splite source package

* Sun Jul 15 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 8.0.5_jp-10vl2
- expand some macros.. (FIXME)

* Sat Jul 14 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 8.0.5_jp-10vl1
- use %configure macros
- add Patch 47,50

* Thu May 31 2001 <sagami@vinelinux.org>
- 8.0.5_jp-10
- unexpand old %%{configure}, new one causes build failure
- fixed missing libtkx.so libtclx.so symlink in /usr/lib
- install manpages into %%{_mandir} and mode 644

* Wed Jul 19 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 8.0.5_jp-9
- modified %install section to handle compressed man pages
- fixed /usr/lib/tk8.0jp/demos.jp/images symlink

* Sun Jul  2 2000 Daisuke SUZUKI <daisuke@linux.or.jp>
- changed default fonts

* Tue Jan 25 2000 Jun Nishii <jun@vinelinux.org>
- added defattr

* Mon Jan 24 2000 Jun Nishii <jun@vinelinux.org>
- added some symlinks, such as libtcl8.0.so.
- obsoletes version number using _jp, now 8.0.5-31vl1

* Wed Jan 5 2000 Norihito Ohmori <nono@vinelinux.org>
- Apply Tcl/Tk 8.0 Japanese Patch 1.7

* Tue Nov 30 1999 Jakub Jelinek <jakub@redhat.com>
- fix tclX symlinks.
- compile on systems where SIGPWR == SIGLOST.

* Sat May  1 1999 Jeff Johnson <jbj@redhat.com>
- update tcl/tk to 8.0.5.
- avoid "containing" in Tix (#2332).

* Thu Apr  8 1999 Jeff Johnson <jbj@redhat.com>
- use /usr/bin/write in kibitz (#1320).
- use cirrus.sprl.umich.edu in weather (#1926).

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 28)

* Mon Mar 08 1999 Preston Brown <pbrown@redhat.com>
- whoops, exec-prefix for itcl was set to '/foo', changed to '/usr'.

* Tue Feb 16 1999 Jeff Johnson <jbj@redhat.com>
- expect does unaligned access on alpha (#989)
- upgrade tcl/tk/tclX to 8.0.4
- upgrade expect to 5.28.
- add itcl 3.0.1

* Tue Jan 12 1999 Cristian Gafton <gafton@redhat.com>
- call libtoolize to allow building on the arm
- build for glibc 2.1
- strip binaries

* Thu Sep 10 1998 Jeff Johnson <jbj@redhat.com>
- update tcl/tk/tclX to 8.0.3, expect is updated also.

* Mon Jun 29 1998 Jeff Johnson <jbj@redhat.com>
- expect: mkpasswd needs delay before sending password (problem #576)

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Sat May 02 1998 Cristian Gafton <gafton@redhat.com>
- fixed expect binaries exec permissions

* Thu Apr 09 1998 Erik Troan <ewt@redhat.com>
- updated to Tix 4.1.0.006
- updated version numbers of tcl/tk to relflect includsion of p2

* Wed Mar 25 1998 Cristian Gafton <gafton@redhat.com>
- updated tcl/tk to patch level 2
- updated tclX to 8.0.2

* Thu Oct 30 1997 Otto Hammersmith <otto@redhat.com>
- fixed filelist for tix... replacing path to the expect binary in scripts
  was leaving junk files around.

* Wed Oct 22 1997 Otto Hammersmith <otto@redhat.com>
- added patch to remove libieee test in configure.in for tcl and tk.
  Shoudln't be needed anymore for glibc systems, but this isn't the "proper" 
  solution for all systems
- fixed src urls

* Mon Oct 06 1997 Erik Troan <ewt@redhat.com>
- removed version numbers from descriptions

* Mon Sep 22 1997 Erik Troan <ewt@redhat.com>
- updated to tcl/tk 8.0 and related versions of packages

* Tue Jun 17 1997 Erik Troan <ewt@redhat.com>
- built against glibc
- fixed dangling tclx/tkx symlinks
