#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

TCLVERSION=8.3

build: build-stamp
build-stamp:
	dh_testdir	
	(export C_INCLUDE_PATH=/usr/include/tcl$(TCLVERSION) ; make -e )
	(export C_INCLUDE_PATH=/usr/include/tcl$(TCLVERSION) ; make -e tcllib )
	(export C_INCLUDE_PATH=/usr/include/tcl$(TCLVERSION) ; make -e pythonlib )
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	make clean
	dh_clean megahal

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs usr/bin usr/lib/megahal
	install -s megahal debian/tmp/usr/bin
	install debian/megahal-personal debian/tmp/usr/bin
	cp -a megahal.aux megahal.ban megahal.grt megahal.swp megahal.trn \
		debian/tmp/usr/lib/megahal
	cp -a mh_python.so libmh_tcl.so debian/tmp/usr/lib/megahal
	dh_installdocs docs/paper.txt docs/README.TXT
	dh_installexamples debian/hal.pl debian/Hal.pm
	dh_installmenu
#	dh_installinit
	dh_installcron
	dh_installmanpages
	dh_link /usr/share/man/man1/megahal.1 /usr/share/man/man1/megahal-personal.1
#	dh_undocumented
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
