#! /usr/bin/make -f
%:
	dh $@

override_dh_auto_install:
	install -m755 partitioner debian/partitioner.postinst
	for i in `find scripts/ -maxdepth 1 -type f -print`; do \
		install -m644 $$i debian/partitioner/usr/share/partitioner/; \
	done

ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)

override_dh_gencontrol:
# fdisk-udeb is not standard priority so will not be installed by anna
# unless partitioner depends on it
ifeq ($(ARCH),mips)
	dh_gencontrol -- -Vfdisk:Depends=fdisk-udeb
else ifeq ($(ARCH),m68k)
	dh_gencontrol -- -Vfdisk:Depends="atari-fdisk-udeb, mac-fdisk-udeb"
endif

override_dh_shlibdeps:
	# dh_installdeb needs to come first, since
	# debian/partitioner/DEBIAN/postinst needs to be scanned for
	# shlibdeps.
	dh_installdeb
	dh_shlibdeps
