#!/usr/bin/make -f

build:
	dh_testdir
	./configure --prefix=/usr --datarootdir=/usr/share

	$(MAKE)
	touch build

clean:
	dh_testdir
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f build intltool-merge intltool-extract intltool-update config.log
	dh_clean

binary-indep:	build
# nothing else to do

binary-arch:	build
	dh_clean
	dh_installdirs
	$(MAKE) install DESTDIR=`pwd`/debian/gpredict
	cp debian/gpredict.desktop debian/gpredict/usr/share/applications
	cp pixmaps/icons/gpredict-icon.png debian/gpredict/usr/share/pixmaps/gpredict.png
	rm debian/gpredict/usr/share/gpredict/COPYING

	dh_installdocs AUTHORS README
	dh_installmenu
	dh_installman debian/gpredict.man
	dh_installchangelogs ChangeLog
	dh_link usr/share/common-licenses/GPL-2 usr/share/gpredict/COPYING
	cp NEWS debian/gpredict/usr/share/doc/gpredict
	dh_strip
	dh_compress
	dh_fixperms
	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
