#!/usr/bin/make -f

export CARGO_HOME=$(shell pwd)/debian/cargo_home
ZSH_COMPDIR = /usr/share/zsh/vendor-completions/

%:
	dh $@ --with python3,bash_completion --buildsystem=pybuild

override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/lintian-brush/$(ZSH_COMPDIR)
	install -m644 debian/lintian-brush.zsh-completion \
	    debian/lintian-brush/$(ZSH_COMPDIR)/_lintian-brush

override_dh_auto_clean:
	for I in . lintian-brush-py; do if test -f $$I/Cargo.lock.saved; then mv $$I/Cargo.lock.saved $$I/Cargo.lock; fi; done
	dh_auto_clean

override_dh_auto_build:
	for I in . lintian-brush-py; do mv $$I/Cargo.lock $$I/Cargo.lock.saved; done
	dh_auto_build

override_dh_auto_test:
	make testsuite
