#!/usr/bin/make -f

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-$(MAKE) clean
	dh_clean

binary-indep: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install -pdi-utils anna-install apt-install debconf-get \
	                      debconf-set register-module user-params bin
	dh_installdirs -pdi-utils usr/lib/prebaseconfig.d
	install register-module.prebaseconfig debian/di-utils/usr/lib/prebaseconfig.d/50register-module
	dh_installdebconf -i
	dh_compress -i
	dh_fixperms -i
	for file in /etc/terminfo/a/ansi /etc/terminfo/l/linux \
	  /etc/terminfo/v/vt102; do \
	  mkdir -p debian/di-utils-terminfo/`dirname $$file`; \
          cp -a $$file debian/di-utils-terminfo/$$file; \
        done
	#$(MAKE) devicefiles  DEVDIR=debian/di-utils-devicefiles
	dh_installdeb -i
	dh_gencontrol -i
	dh_builddeb -i

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install -pdi-utils-mapdevfs mapdevfs bin
	dh_install -pdi-utils-bootfloppy pipe_progress bin
	dh_installdebconf -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_strip -a # should come after dh_installdeb; binary postinst
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_builddeb -a

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