#!/usr/bin/make -f
# -*- makefile -*-

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-stamp
build-stamp: configure-stamp 
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	dh_clean 

install:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i

	mkdir -p debian/terminfo-base/usr/share debian/terminfo-ext/usr/share
	cp -a base/* debian/terminfo-base/usr/share
	cp -a ext/* debian/terminfo-ext/usr/share

	dh_install -i

# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
#	dh_installmenu
#	dh_installdebconf
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
#	dh_installcron
#	dh_installinfo
#	dh_installman
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
#	dh_perl
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb
# Build architecture independant packages using the common target.
binary binary-arch binary-indep: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

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