#!/usr/bin/make -f

build:
	dh_testdir
	touch aclocal.m4
	touch Makefile.in */Makefile.in */*/Makefile.in
	touch config.h.in
	touch configure
	CFLAGS=-I/usr/include/geotiff ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
	$(MAKE)
	touch build

clean:
	dh_testdir
	-rm -f build
	[ ! -f Makefile ] || $(MAKE) distclean
	-rm -f src/callpass/Makefile
	-rm -f config.log config.cache summary.log
	dh_clean

binary-indep:	build
# nothing else to do

binary-arch:	build
	dh_clean
	dh_installdirs
	CFLAGS=-I/usr/include/geotiff $(MAKE) install DESTDIR=`pwd`/debian/xastir
	cp src/testdbfawk debian/xastir/usr/lib/xastir
	rm -f debian/xastir/usr/share/doc/xastir/*

	dh_installdocs AUTHORS README README.MAPS README.Contributing README.CVS README.Getting-Started FAQ NEWS UPGRADE
	dh_installmenu
	dh_installchangelogs ChangeLog
	dh_installman
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary:		binary-indep binary-arch

checkroot:
	dh_testdir
	dh_testroot

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