#!/usr/bin/make -f
# debian/rules for alien

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

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 debian/`dh_listpackages`.modules
	-$(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
	mkdirhier debian/tmp/etc/devfs/conf.d
	cp debian/etc_devfs_conf.d_ltmodem debian/tmp/etc/devfs/conf.d/ltmodem

	dh_testdir
	dh_testroot
	dh_fixperms

#
# If you need to move files around in debian/$(PACKAGE) or do some
# binary patching, do it here
#
#	dh_installdocs DOCs/* utils/* 
#	dh_installchangelogs -k CHANGELOG
# This has been known to break on some wacky binaries.
#	dh_strip
	dh_compress
# This is too paramoid to be generally useful to alien.
#	dh_fixperms
	dh_makeshlibs

	dh_installdeb
	-dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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


