--- /dev/null
+#!/usr/bin/make -f
+
+# chiark-tcl - various Tcl bindings and extensions
+# Copyright 2006 Ian Jackson
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+
+majversion=1
+srcpackage=chiark-tcl
+libpackage=libtcl-chiark-$(majversion)
+docpackage=libtcl-chiark-$(majversion)
+docdir=usr/share/doc/$(docpackage)
+
+define checkdir
+ test -f hbytes/hbytes.tct
+endef
+
+build:
+ $(checkdir)
+ $(MAKE) prefix=/usr VERSION=$(majversion)
+
+clean:
+ $(checkdir)
+ $(MAKE) clean
+ rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
+ dh_clean
+
+binary-indep:
+
+binary-arch: checkroot build
+ $(checkdir)
+ -rm -rf debian/$(docpackage) debian/$(libpackage)
+ install -d debian/$(libpackage)/usr/lib
+ install -d debian/$(docpackage)/usr/share/doc/$(docpackage)
+
+ cp */*.so debian/$(libpackage)/usr/lib/.
+
+ set -e; for f in */*.[ch]; do \
+ perl debian/extractdoc <$$f \
+ debian/$(docpackage)/$(docdir)/ $$f .txt; \
+ done
+ cp */*.tct debian/README debian/copyright \
+ debian/$(docpackage)/$(docdir)
+
+ dh_installchangelogs
+ dh_strip
+
+ dh_shlibdeps
+ dh_compress
+ dh_fixperms
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Below here is fairly generic really
+
+binary: binary-indep binary-arch
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+checkroot:
+ $(checkdir)
+ dh_testroot
+
+.PHONY: binary binary-arch binary-indep clean checkroot