#!/usr/bin/make -f
# tpmnt builds fully offline: build-source.sh vendors every crate into vendor/
# and writes .cargo/config.toml, so Launchpad's network-less builders are fine.

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CARGO_HOME = $(CURDIR)/debian/cargo-home

%:
	dh $@

override_dh_auto_build:
	cargo build --release --offline --locked

# tpmnt's tests need root + a TPM/loopback; not runnable on a build farm.
override_dh_auto_test:

override_dh_auto_install:
	install -Dm0755 target/release/tpmnt debian/tpmnt/usr/bin/tpmnt
	install -Dm0644 man/tpmnt.1 debian/tpmnt/usr/share/man/man1/tpmnt.1

override_dh_auto_clean:
	rm -rf target debian/cargo-home
