#!/usr/bin/make -f
%:
	dh $@ --buildsystem cargo --with bash-completion

override_dh_auto_test:
	dh_auto_test -- test --all || true

override_dh_installman:
	help2man \
		--name hyperfine \
		--no-info \
		debian/hyperfine/usr/bin/hyperfine > debian/hyperfine.1
	dh_installman -O--buildsystem=cargo

override_dh_dwz:
	# Don't do anything. fails because of the
	# https://github.com/rust-lang/rust/issues/66118

override_dh_auto_install:
	dh_auto_install --destdir=debian/hyperfine

override_dh_install:
	dh_install
	set -e; for f in scripts/*.py; do \
		n=$$(basename $$f .py | tr '_' '-'); \
		install -D -m 755 $$f debian/hyperfine-scripts/usr/bin/hyperfine-$$n; \
	done
