#!/usr/bin/make -f

build: clean
	./configure $(CONF_OPTS)
	$(MAKE) clean all && touch build

clean:
	dh_testdir
	dh_clean
	rm -rf debian/tmp build
	rm -f debian/postinst debian/postrm 
	-$(MAKE) proper

binary-indep:

binary-arch: build
	$(MAKE) ROOTDIR=$(CURDIR)/debian/tmp install
	cp autoload debian/postinst
	echo '#DEBHELPER#' >> debian/postinst
	cp cleanup debian/postrm
	echo '#DEBHELPER#' >> debian/postrm
	dh_testdir
	dh_testroot
	dh_installdocs  DOCs/ utils/
	dh_fixperms

	dh_installmodules

	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
