#!/usr/bin/make -f

# Make sure the man page and shell completion uses the correct binary name
export PROJECT_EXECUTABLE = batcat

%:
	dh $@ --buildsystem cargo --with shell_completions

override_dh_auto_install:
	# Once #946616 is fixed run `dh_auto_install --destdir=debian/tmp/`
	# and use d/bat.install with dh-exec to install the renamed binary.
	dh_auto_install
	mv debian/bat/usr/bin/bat debian/bat/usr/bin/batcat

override_dh_install: export TARGETDIR=$(wildcard target/*/release/build/bat-*/out)
override_dh_install:
	dh_install

override_dh_installman:
	cp target/*/release/build/bat-*/out/assets/manual/bat.1 doc/batcat.1
	dh_installman
