#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_test:
	@set -e; for f in etc/initramfs/post-update.d/* hooks/* scripts/panic/adbd scripts/touch usr/sbin/*; do \
	    echo "Checking sh syntax of $$f"; \
	    sh -n $$f; \
	done

override_dh_auto_clean:
	rm -rf ./build || true
	dh_auto_clean

override_dh_auto_build:
	./build-initrd.sh
	dh_auto_build

override_dh_install:
	dh_install
	sed -i -e's/#DEB_HOST_MULTIARCH#/$(DEB_HOST_MULTIARCH)/g' \
		debian/initramfs-tools-ubuntu-touch/usr/share/initramfs-tools/hooks/touch
