#!/usr/bin/make -f
pkg		:= $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')

DESTDIR		:= `pwd`/debian/$(pkg)
HELPDIR		:= `pwd`/debian/$(pkg)/usr/share/$(pkg)

%:
	dh $@  --with autotools-dev --with autoreconf

override_dh_auto_clean:
	dh_auto_clean
	rm -f helical/sample-helical.sh tools/sample-ctsim.sh

override_dh_autoconfigure:
	./configure --prefix=$(DESTDIR)/usr --mandir=$(DESTDIR)/usr/share/man --datadir=$(HELPDIR) --with-ctn -with-x --without-lam

override_dh_installdocs-indep:
	(cd docs; tar xzf html.tar.gz)
	dh_installdocs -i

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog
