--- tclx8.4-8.4.0.orig/debian/changelog
+++ tclx8.4-8.4.0/debian/changelog
@@ -0,0 +1,48 @@
+tclx8.4 (8.4.0-3) unstable; urgency=low
+
+  * In pkgIndex.tcl load the library on Tcl >= 8.4.  
+    Closes: #538701.
+
+  * Fixed build on GNU/kFreeBSD.
+    Closes: #561064.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Sun, 10 Jan 2010 10:20:12 +0100
+
+tclx8.4 (8.4.0-2) unstable; urgency=low
+
+  * In pkgIndex.tcl load the library only on Tcl 8.4.
+    Closes: #442469.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Mon, 06 Apr 2009 12:41:14 +0200
+
+tclx8.4 (8.4.0-1) unstable; urgency=low
+
+  * Official upstream release.
+
+  * Fixed typo in tclconfig/tcl.m4.
+    Closes: #353850.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Wed, 13 Sep 2006 15:20:28 +0200
+
+tclx8.4 (0.20050517-2) unstable; urgency=low
+
+  * Fixed typo in configure.
+    Closes: #353850.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Sat, 11 Mar 2006 19:32:16 +0100
+
+tclx8.4 (0.20050517-1) unstable; urgency=low
+
+  * New release from current CVS snapshot.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Tue, 17 May 2005 13:45:51 +0200
+
+tclx8.4 (0.20040109-1) unstable; urgency=low
+
+  * Initial release, from current CVS snapshot.
+    Closes #177506.
+
+  * Renamed all manpages to <manpage>.3tclx.
+
+ -- Massimo Dal Zotto <dz@debian.org>  Fri,  9 Jan 2004 15:54:49 +0100
+
--- tclx8.4-8.4.0.orig/debian/tclx8.4-doc.install
+++ tclx8.4-8.4.0/debian/tclx8.4-doc.install
@@ -0,0 +1 @@
+usr/share/man/man3/*
--- tclx8.4-8.4.0.orig/debian/compat
+++ tclx8.4-8.4.0/debian/compat
@@ -0,0 +1 @@
+5
--- tclx8.4-8.4.0.orig/debian/tclx8.4.install
+++ tclx8.4-8.4.0/debian/tclx8.4.install
@@ -0,0 +1,2 @@
+usr/lib/libtclx*.so.*
+usr/lib/tclx*/*.tcl
--- tclx8.4-8.4.0.orig/debian/tclx8.4.dirs
+++ tclx8.4-8.4.0/debian/tclx8.4.dirs
@@ -0,0 +1 @@
+usr/lib/tclx8.4
--- tclx8.4-8.4.0.orig/debian/tclx8.4-doc.dirs
+++ tclx8.4-8.4.0/debian/tclx8.4-doc.dirs
@@ -0,0 +1 @@
+usr/share/man/man3
--- tclx8.4-8.4.0.orig/debian/BUILD_NOTES
+++ tclx8.4-8.4.0/debian/BUILD_NOTES
@@ -0,0 +1,23 @@
+BUILD NOTES FOR TCLX ON DEBIAN
+==============================
+
+1)  patches to tclconfig/tcl.m4:
+
+    - set SHLIB_SUFFIX=".so.0"
+
+    - added "-Wl,-soname,$@" to MAKE_SHARED_LIB variable
+
+    - fixed "/etc/.relid'" typo
+
+    - fixed tclsh program detection (backported from v1.15)
+
+2)  patches to Makefile.in
+
+    - set TESTFLAGS = -notfile "nice.test pipe.test process.test signal.test"
+
+3)  the original configure is buggy, since it was generated with
+    a buggy tcl.m4, and must be rebuilt with autoconf.
+
+4)  all manpages must be in tclx8.4-doc since they conflict with
+    manpages of other tclx versions.  Manpages must be installed
+    with the install_manpages script to conform to debian policy.
--- tclx8.4-8.4.0.orig/debian/control
+++ tclx8.4-8.4.0/debian/control
@@ -0,0 +1,60 @@
+Source: tclx8.4
+Section: libs
+Priority: optional
+Maintainer: Massimo Dal Zotto <dz@debian.org>
+Build-Depends: debhelper (>= 5), autotools-dev, tcl8.4-dev, autoconf
+Standards-Version: 3.7.2
+
+Package: tclx8.4
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Provides: tclx
+Suggests: tclx8.4-doc
+Description: Extended Tcl (TclX) - shared library
+ Extended Tcl (TclX), is a set of extensions to Tcl, the Tool Command
+ Language invented by Dr. John Ousterhout.  Tcl is a powerful, yet simple
+ embeddable programming language.  Extended Tcl is oriented towards system
+ programming tasks and large application development.
+ .
+ TclX provides additional interfaces to the operating system, and adds many
+ new programming constructs, text manipulation tools, and debugging tools.
+ .
+ TclX 8.4 differs from its predecessors in that it is based more on the
+ idea of TclX as an extension to Tcl, and not an alternate environment.
+ There is no TkX and no stand-alone shells are built. The tkx*8.4 packages
+ therefore don't exist anymore.
+ .
+ This package includes the shared library and tcl library files.
+
+Package: tclx8.4-dev
+Section: devel
+Architecture: any
+Depends: tclx8.4 (= ${Source-Version}), tcl8.4-dev
+Suggests: tclx8.4-doc
+Description: Extended Tcl (TclX) - development package
+ Extended Tcl (TclX), is a set of extensions to Tcl, the Tool Command
+ Language invented by Dr. John Ousterhout.  Tcl is a powerful, yet simple
+ embeddable programming language.  Extended Tcl is oriented towards system
+ programming tasks and large application development.
+ .
+ TclX provides additional interfaces to the operating system, and adds many
+ new programming constructs, text manipulation tools, and debugging tools.
+ .
+ This package includes development libraries and include files.
+
+Package: tclx8.4-doc
+Section: doc
+Architecture: all
+Provides: tclx-doc
+Conflicts: tclx-doc, tkx-doc
+Description: Extended Tcl (TclX) - manpages
+ Extended Tcl (TclX), is a set of extensions to Tcl, the Tool Command
+ Language invented by Dr. John Ousterhout.  Tcl is a powerful, yet simple
+ embeddable programming language.  Extended Tcl is oriented towards system
+ programming tasks and large application development.
+ .
+ TclX provides additional interfaces to the operating system, and adds many
+ new programming constructs, text manipulation tools, and debugging tools.
+ .
+ This package includes the TclX man pages.
--- tclx8.4-8.4.0.orig/debian/copyright
+++ tclx8.4-8.4.0/debian/copyright
@@ -0,0 +1,32 @@
+This package was debianized by unknown <dz@debian.org> on
+Wed, 13 Sep 2006 15:20:28 +0200.
+
+It was downloaded from http://sourceforge.net/projects/tclx/.
+
+Upstream Authors: Mark Diekhans <markd at Kermodei.com>
+		  Karl Lehenbauer <karl at procplace.com>
+
+Copyright: 
+
+ *-----------------------------------------------------------------------------
+ * Copyright 1991-1999 Karl Lehenbauer and Mark Diekhans.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies.  Karl Lehenbauer and
+ * Mark Diekhans make no representations about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *-----------------------------------------------------------------------------
+
+License:
+
+Extended Tcl was designed and implemented by Karl Lehenbauer (karl at
+procplace.com) and Mark Diekhans (markd at Kermodei.com), with help in the
+earliest stages from Peter da Silva (peter at NeoSoft.com).
+TclX 8.4 work was done by Jeff Hobbs.
+
+As with Tcl, all of Extended Tcl is freely redistributable, including for
+commercial use and resale (BSD-style license).
+
+See `/usr/share/common-licenses/BSD'.
--- tclx8.4-8.4.0.orig/debian/docs
+++ tclx8.4-8.4.0/debian/docs
@@ -0,0 +1,2 @@
+README
+debian/KNOWN_BUGS
--- tclx8.4-8.4.0.orig/debian/install_manpages
+++ tclx8.4-8.4.0/debian/install_manpages
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Install tclx man pages in debian build directory.
+
+DESTDIR=${1:-./debian/tmp}
+MAN3DIR=${DESTDIR}/usr/share/man/man3
+MANNDIR=${DESTDIR}/usr/share/man/mann
+
+mkdir -p ${MAN3DIR}
+
+# Move manpages from mann to man3
+for f in ${MANNDIR}/*; do
+    test -e "$f" || continue
+    name=${f##*/}; name=${name%.n}.3tclx
+    # Replace section TCL with 3tclx
+    #mv -f $f ${MAN3DIR}/$name
+    cat $f | sed '/^\.TH/ s/TCL/3tclx/' > ${MAN3DIR}/$name; rm $f
+    gzip -f9 ${MAN3DIR}/$name
+done
+
+# Install manpages in man3
+for f in doc/*.3; do
+    test -e "$f" || continue
+    name=${f##*/}tclx
+    names=$(cat $f | sed '1,/\.SH NAME/d; s/.-.*//g; s/,//g; q')
+    # Replace section TCL with 3tclx
+    #cp -fp $f ${MAN3DIR}/$name
+    cat $f | sed '/^\.TH/ s/TCL/3tclx/' > ${MAN3DIR}/$name
+    gzip -f9 ${MAN3DIR}/$name
+    for n in $names; do
+	test -e ${MAN3DIR}/$n.3tclx.gz && continue
+	ln -nfs $name.gz ${MAN3DIR}/$n.3tclx.gz
+    done
+done
+
+# end of file
--- tclx8.4-8.4.0.orig/debian/tclx8.4-dev.dirs
+++ tclx8.4-8.4.0/debian/tclx8.4-dev.dirs
@@ -0,0 +1 @@
+usr/include/tclx8.4
--- tclx8.4-8.4.0.orig/debian/KNOWN_BUGS
+++ tclx8.4-8.4.0/debian/KNOWN_BUGS
@@ -0,0 +1,10 @@
+The fork and wait commands don't work in Debian's version of tclx because
+fork is incompatible with the threaded Tcl distributed with Debian.
+For more information see
+
+    http://sourceforge.net/tracker/index.php?func=detail&aid=749639&group_id=10894&atid=110894
+
+If you need fork in tclx you must download the sources of tcl8.4 and tclx
+CVS and recompile both packages with threads disabled.
+
+DON'T REPORT BUGS ABOUT 'fork' AND 'wait' NOT WORKING!!!
--- tclx8.4-8.4.0.orig/debian/rules
+++ tclx8.4-8.4.0/debian/rules
@@ -0,0 +1,240 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+PKGNAME  = $(shell head -1 debian/changelog | sed 's/ .*//')
+VERSION	 = $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//')
+PKGFILES = $(PKGNAME)_$(VERSION)_$(shell dpkg --print-architecture).deb \
+	   $(PKGNAME)-dev_$(VERSION)_$(shell dpkg --print-architecture).deb \
+	   $(PKGNAME)-doc_$(VERSION)_all.deb
+CHANGES	 = $(PKGNAME)_$(VERSION)_$(shell dpkg --print-architecture).changes
+
+TCLX_VERSION   = $(shell head -1 debian/changelog | sed 's/ .*//;s/tclx//')
+TCL_VERSION    = $(TCLX_VERSION)
+TCL_CONFIG     = /usr/lib/tcl$(TCL_VERSION)
+TCL_THREADS    = $(shell . $(TCL_CONFIG)/tclConfig.sh && echo $$TCL_THREADS)
+ENABLE_THREADS = $(shell test "$(TCL_THREADS)" = 1 && echo --enable-threads)
+DESTDIR	       = $(CURDIR)/debian/tmp
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure: tclconfig/tcl.m4
+	# Rebuild configure with new tcl.m4
+	autoconf
+	rm -rf autom4te.cache
+
+config.status: configure
+	dh_testdir
+	# Not done here since configure must be invoked
+	# separately for static and shared libraries.
+	#./configure \
+	#    --host=$(DEB_HOST_GNU_TYPE) \
+	#    --build=$(DEB_BUILD_GNU_TYPE) \
+	#    --prefix=/usr \
+	#    --mandir=\$${prefix}/share/man \
+	#    --infodir=\$${prefix}/share/info \
+	#    --with-tcl=/usr/lib/tcl$(TCL_VERSION) \
+	#    --enable-shared \
+	#    $(ENABLE_THREADS) \
+	#    CFLAGS="$(CFLAGS)" \
+	#    LDFLAGS="-Wl,-z,defs"
+
+build: build-stamp
+
+build-stamp: build-stamp-static build-stamp-shared
+	touch build-stamp-static
+	touch build-stamp-shared
+	touch $@
+
+build-stamp-static: config.status
+	dh_testdir
+	# Compile the static library
+	rm -f config.cache config.log config.status *.o pkgIndex.tcl
+	./configure \
+	    --host=$(DEB_HOST_GNU_TYPE) \
+	    --build=$(DEB_BUILD_GNU_TYPE) \
+	    --prefix=/usr \
+	    --mandir=\$${prefix}/share/man \
+	    --infodir=\$${prefix}/share/info \
+	    --with-tcl=/usr/lib/tcl$(TCL_VERSION) \
+	    --disable-shared \
+	    $(ENABLE_THREADS) \
+	    CFLAGS="$(CFLAGS)" \
+	    LDFLAGS="-Wl,-z,defs"
+	$(MAKE)
+	touch $@
+
+build-stamp-shared: config.status
+	dh_testdir
+	# Compile the shared library
+	rm -f config.cache config.log config.status *.o pkgIndex.tcl
+	./configure \
+	    --host=$(DEB_HOST_GNU_TYPE) \
+	    --build=$(DEB_BUILD_GNU_TYPE) \
+	    --prefix=/usr \
+	    --mandir=\$${prefix}/share/man \
+	    --infodir=\$${prefix}/share/info \
+	    --with-tcl=/usr/lib/tcl$(TCL_VERSION) \
+	    --enable-shared \
+	    $(ENABLE_THREADS) \
+	    CFLAGS="$(CFLAGS)" \
+	    LDFLAGS="-Wl,-z,defs"
+	$(MAKE)
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp*
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+	cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+	cp -f /usr/share/misc/config.guess config.guess
+endif
+	dh_clean
+	-rm -rf pkgIndex.tcl libtclx*.* config.* $$(find . -name CVS)
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	# Add here commands to install the package into debian/tmp.
+	$(MAKE) install DESTDIR=$(DESTDIR)
+	cp -fp libtclx*.a $(DESTDIR)/usr/lib/
+
+	# Fix the installation
+	mv $(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/lib* $(DESTDIR)/usr/lib/
+	ln -nfs libtclx$(TCLX_VERSION).so.0 \
+	    $(DESTDIR)/usr/lib/libtclx$(TCLX_VERSION).so
+	mkdir -p $(DESTDIR)/usr/include/tclx$(TCLX_VERSION)
+	mv $(DESTDIR)/usr/include/*.h \
+	    $(DESTDIR)/usr/include/tclx$(TCLX_VERSION)/
+	sh ./debian/install_manpages $(DESTDIR)
+	ln -nfs TclX.3tclx.gz $(DESTDIR)/usr/share/man/man3/tclx.3tclx.gz
+	# Load only on tcl8.4
+	echo 'if {[package vcompare [info tclversion] 8.4] < 0} return' \
+	    > $(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/pkgIndex.tcl
+	sed 's|\$$dir|/usr/lib|' < pkgIndex.tcl \
+	    >>$(DESTDIR)/usr/lib/tclx$(TCLX_VERSION)/pkgIndex.tcl
+
+	# Copy files in packages directories
+	dh_install -v --sourcedir=debian/tmp
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir -i
+	dh_testroot -i
+	dh_installchangelogs ChangeLog -i
+	dh_installdocs -i
+	# dh_installexamples -i
+	# dh_install -i
+	# dh_installmenu -i
+	# dh_installdebconf -i
+	# dh_installlogrotate -i
+	# dh_installemacsen -i
+	# dh_installpam -i
+	# dh_installmime -i
+	# dh_python -i
+	# dh_installinit -i
+	# dh_installcron -i
+	# dh_installinfo -i
+	dh_installman -i
+	dh_link -i
+	# dh_strip -i
+	dh_compress -i
+	dh_fixperms -i
+	# dh_perl -i
+	# dh_makeshlibs -i
+	dh_installdeb -i
+	# dh_shlibdeps -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir -a
+	dh_testroot -a
+	dh_installchangelogs ChangeLog -a
+	dh_installdocs -a
+	# dh_installexamples -a
+	# dh_install -a
+	# dh_installmenu -a
+	# dh_installdebconf -a
+	# dh_installlogrotate -a
+	# dh_installemacsen -a
+	# dh_installpam -a
+	# dh_installmime -a
+	# dh_python -a
+	# dh_installinit -a
+	# dh_installcron -a
+	# dh_installinfo -a
+	dh_installman -a
+	dh_link -a
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a
+	# dh_perl -a
+	dh_makeshlibs -a
+	dh_installdeb -a
+	dh_shlibdeps -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 
+
+package:
+	dh_testdir
+	dpkg-buildpackage -rfakeroot
+
+dist:
+	dh_testdir
+	dpkg-buildpackage -rfakeroot
+
+deb:
+	dh_testdir
+	dpkg-buildpackage -rfakeroot -us -uc
+
+debclean:
+	dh_testdir
+	fakeroot ./debian/rules clean
+
+debinst:
+	dh_testdir
+	cd .. && sudo dpkg -i $(PKGFILES)
+
+lintian:
+	dh_testdir
+	cd .. && lintian -i $(PKGFILES)
+
+upload:
+	dh_testdir
+	cd .. && grep -q 'PGP SIGNED MESSAGE' $(CHANGES) && dupload $(CHANGES)
+
--- tclx8.4-8.4.0.orig/debian/tclx8.4-dev.install
+++ tclx8.4-8.4.0/debian/tclx8.4-dev.install
@@ -0,0 +1,3 @@
+usr/lib/libtclx*.a
+usr/lib/libtclx*.so
+usr/include/*/tclExtend.h
