%define enable_japanese 1 %define prefix /usr/local %define tclvers 8.0.5 %define itclvers 3.0.1 %ifos darwin %define __soext dylib %define __cpoption -pP %else %define __soext so %define __cpoption -a %endif Summary: A Tcl/Tk development environment: tcl, tk, and itcl. Name: jp-tcltk Version: %{tclvers} Release: 36c Source0: ftp://ftp.scriptics.com/pub/tcl/tcl8_0/tcl%{tclvers}.tar.gz Source1: ftp://ftp.scriptics.com/pub/tcl/tcl8_0/tk%{tclvers}.tar.gz Source2: ftp://ftp.tcltk.com/pub/itcl/itcl%{itclvers}.tar.gz Patch0: tcl8.0.3-glibc21.patch Patch1: tcl8.0.5-sigpwr.patch Patch2: tcltk-8.0.4-ppc.patch Patch3: itcl_fix.diff Patch4: ftp://ftp.sra.co.jp/pub/lang/tcl/jp/tcl%{tclvers}jp1.6.patch.gz Patch5: ftp://ftp.sra.co.jp/pub/lang/tcl/jp/tk%{tclvers}jp1.6a.patch.gz Patch6: tk%{tclvers}jp1.6a-im.patch Patch7: tcl8.0.5jp-path.patch Patch8: itcl3.0.1jp-tkpath.patch Patch9: tcl8.0.5-macosx-shared.patch Patch10: tk8.0.5-macosx-shared.patch Patch11: itcl3.0.1-macosx-shared.patch Patch12: tcl8.0.5-macosx-environ.patch Copyright: BSD Group: Development/Languages URL: http://www.scriptics.com Buildroot: /var/tmp/%{name}-root Prefix: %{prefix} %description Tcl is a simple scripting language designed to be embedded into other applications. Tcl is designed to be used with Tk, a widget set, which is provided in the tk package. This package also includes tclsh, a simple example of a Tcl application. Tk is a widget set for the X Window System that is designed to work closely with the Tcl scripting language. It allows you to write simple programs with full featured GUI's in only a little more time then it takes to write a text based interface. Tcl/Tk applications can also be run on Windows and Macintosh platforms. %package -n jp-itcl Version: %{itclvers} Summary: Object-oriented mega-widgets for Tcl. Group: Development/Languages %description -n jp-itcl [incr Tcl] is an object-oriented extension of the Tcl language and was created to support more structured programming in Tcl. Tcl scripts longer than a few thousand lines become extremely difficult to maintain because the building blocks of vanilla Tcl are procedures and global variables. All of these building blocks must reside in a single global namespace and there is no support for protection or encapsulation. To help out with this problem, [incr Tcl] introduces the notion of objects. Each object is a bag of data with a set of procedures or "methods" that are used to manipulate it. Objects are organized into "classes" with identical characteristics, and classes can inherit functionality from one another. This object-oriented paradigm adds another level of organization on top of the basic variable/procedure elements, and the resulting code is easier to understand and maintain. Install itcl if you're programming with Tcl, and you need the object-oriented functionality that [incr Tcl] can provide. %prep %setup -n jp-tcltk-%{tclvers} -q -c -a 1 -a 2 cd tcl%{tclvers} %patch0 -p2 -b .glibc21 %patch1 -p2 -b .sigpwr cd .. cd tk%{tclvers} %ifarch ppc %patch2 -p2 %endif cd .. cd itcl%{itclvers} %patch3 -p5 cd .. %if %{enable_japanese} cd tcl%{tclvers} %patch4 -p0 -b .jp %patch9 -p1 -b .macosx %patch12 -p1 -b .macosx cd .. cd tk%{tclvers} %patch5 -p0 -b .jp %patch6 -p1 -b .im %patch7 -p2 -b .path %patch10 -p1 -b .macosx cd .. cd itcl%{itclvers} %patch8 -p1 -b .tkpath %patch11 -p1 -b .macosx cd .. %endif #========================================== %build # make the libraries reentrant RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_REENTRANT" #------------------------------------------ # Tcl # cd tcl%{tclvers}/unix ./configure --enable-shared --enable-gcc --prefix=%{prefix} make cd ../.. #------------------------------------------ # Tk # cd tk%{tclvers}/unix ./configure --enable-shared --enable-gcc --with-tcl=../../tcl%{tclvers}/unix \ --prefix=%{prefix} make cd ../.. #------------------------------------------ # itcl # cd itcl%{itclvers} ./configure --enable-shared --prefix=%{prefix} --exec-prefix=/foo --enable-gcc \ --with-tcl=$RPM_BUILD_DIR/jp-tcltk-%{tclvers}/tcl%{tclvers}/unix \ --with-tk=$RPM_BUILD_DIR/jp-tcltk-%{tclvers}/tk%{tclvers}/unix %if %{enable_japanese} make CC='gcc -DKANJI -DKINPUT2 -DXIM_IMPROVE' %else make %endif cd .. #========================================== %install rm -rf $RPM_BUILD_ROOT rm -f *.files* mkdir -p $RPM_BUILD_ROOT%{prefix} #------------------------------------------ # itcl # cd itcl%{itclvers} make INSTALL_ROOT=$RPM_BUILD_ROOT exec_prefix=%{prefix} install ln -sf libitk3.0.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libitk.%{__soext} ln -sf libitcl3.0.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libitcl.%{__soext} cd .. for n in `cat itcl.files`; do if head -1 $n | grep '#!'; then cp %{__cpoption} $n $n.in chmod u+w $n sed "s|$RPM_BUILD_ROOT||" < $n.in > $n rm -f $n.in fi done cd .. # I hate case-insensitive file systems %ifos darwin cd $RPM_BUILD_ROOT%{prefix}/man/mann mv messagebox.n itcl::messagebox mv optionmenu.n itcl::optionMenu.n mv Toplevel.n itcl::Toplevel.n cd $RPM_BUILD_DIR/jp-tcltk-%{tclvers} %endif (find $RPM_BUILD_ROOT%{prefix}/bin $RPM_BUILD_ROOT%{prefix}/include \ $RPM_BUILD_ROOT%{prefix}/man -type f -o -type l; find $RPM_BUILD_ROOT%{prefix}/lib/*) | sort > itcl.files #------------------------------------------ # Tcl # cd tcl%{tclvers}/unix make INSTALL_ROOT=$RPM_BUILD_ROOT install ln -sf libtcl8.0.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libtcl.%{__soext} ln -sf tclsh8.0 $RPM_BUILD_ROOT%{prefix}/bin/tclsh %if %{enable_japanese} ln -sf libtcl8.0jp.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libtcl8.0.%{__soext} ln -sf tclsh8.0jp $RPM_BUILD_ROOT%{prefix}/bin/tclsh8.0 %endif cd .. rm -f README.JP.* changes.JP.* mv Incompat80jp tcl.Incompat80jp mv README tcl.README mv README.JP tcl.README.JP mv changes tcl.changes mv changes.JP tcl.changes.JP mv license.terms tcl.license.terms cd .. #------------------------------------------ # Tk # cd tk%{tclvers}/unix make INSTALL_ROOT=$RPM_BUILD_ROOT install ln -sf libtk8.0.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libtk.%{__soext} ln -sf wish8.0 $RPM_BUILD_ROOT%{prefix}/bin/wish %if %{enable_japanese} ln -sf libtk8.0jp.%{__soext} $RPM_BUILD_ROOT%{prefix}/lib/libtk8.0.%{__soext} ln -sf wish8.0jp $RPM_BUILD_ROOT%{prefix}/bin/wish8.0 %endif cd .. rm -f README.JP.* changes.JP.* mv Incompat80jp tk.Incompat80jp mv README tk.README mv README.JP tk.README.JP mv changes tk.changes mv changes.JP tk.changes.JP mv license.terms tk.license.terms cd .. (find $RPM_BUILD_ROOT%{prefix}/bin $RPM_BUILD_ROOT%{prefix}/include \ $RPM_BUILD_ROOT%{prefix}/man -type f -o -type l; find $RPM_BUILD_ROOT%{prefix}/lib/*) | cat - itcl.files \ | sort | uniq -u > tcltk.files #------------------------------------------ # this is too annoying to watch 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 %ifnos darwin #Strip the binaries strip $RPM_BUILD_ROOT%{prefix}/bin/* || : %endif # Man pages can be compressed for file in *.files ; do mv $file $file.in sed -e 's|%{prefix}/man/man.*$|&\*|' < $file.in > $file rm -f $file.in done #========================================== %ifnos darwin %post -p /sbin/ldconfig -n jp-tcltk %post -p /sbin/ldconfig -n jp-itcl %postun -p /sbin/ldconfig -n jp-tcltk %postun -p /sbin/ldconfig -n jp-itcl %endif %clean rm -rf $RPM_BUILD_ROOT rm -f *.files* %files -f tcltk.files -n jp-tcltk %if %{enable_japanese} %ifos darwin %attr(-,root,wheel) %doc tcl%{tclvers}/*README* tcl%{tclvers}/*Incompat80jp %attr(-,root,wheel) %doc tcl%{tclvers}/*changes* tcl%{tclvers}/*license.terms %attr(-,root,wheel) %doc tk%{tclvers}/*README* tk%{tclvers}/*Incompat80jp %attr(-,root,wheel) %doc tk%{tclvers}/*changes* tk%{tclvers}/*license.terms %else %attr(-,root,root) %doc tcl%{tclvers}/*README* tcl%{tclvers}/*Incompat80jp %attr(-,root,root) %doc tcl%{tclvers}/*changes* tcl%{tclvers}/*license.terms %attr(-,root,root) %doc tk%{tclvers}/*README* tk%{tclvers}/*Incompat80jp %attr(-,root,root) %doc tk%{tclvers}/*changes* tk%{tclvers}/*license.terms %endif %endif %files -f itcl.files -n jp-itcl %changelog * Thu Oct 11 2002 Keisuke Fujii - version 8.0.5-36c built against MacOS X Release 10.1 - modified MacOS X patches to use twolevel-namespace * Thu Oct 11 2002 Keisuke Fujii - version 8.0.5-36b built against MacOS X Release 10.1 - added MacOS X patches * Sun Apr 22 2002 Keisuke Fujii - version 8.0.5-36a built against MacOS X Release 10.0.01 - added MacOS X patches * Mon Aug 28 2000 Keisuke Fujii - version 8.0.5-35a - install into /usr/local - lighter version for jp-TkDesk, etc. - added tcltk-8.0.4-ppc.patch and itcl_fix.diff