#!/usr/bin/make -f
# This script now only processes the source package alone, 
# there is no longer any kernel module package.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

TOP=$(shell pwd)/debian/toshutils
    
# Build everything
build: build-stamp
build-stamp:
	dh_testdir
	./configure --prefix=/usr --mandir=/usr/share/man
	$(MAKE) depend
	$(MAKE) all
	touch build-stamp


clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-$(MAKE) distclean
	dh_clean src/Makefile

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

# Build architecture-dependent files that aren't kernel modules here.
binary-arch: build
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs usr/share/man/man1 usr/share/man/man8 usr/bin \
		usr/X11R6/include/X11/pixmaps \

	cp pixmaps/fan*.xpm pixmaps/displayswitch.xpm pixmaps/tuxtime.xpm \
		debian/toshutils/usr/X11R6/include/X11/pixmaps
	$(MAKE) BINDESTDIR=$(TOP)/usr/bin MANDESTDIR=$(TOP)/usr/share/man install-doc
	$(MAKE) BINDESTDIR=$(TOP)/usr/bin MANDESTDIR=$(TOP)/usr/share/man install-prog

	dh_installdocs README* TODO CONTRIBUTE FAQ
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installinfo
	dh_installchangelogs ChangeLog
	dh_installmodules
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	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

