export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CARGO_HOME = $(CURDIR)/debian/cargo
export CARGO_TARGET_DIR = $(CURDIR)/target
%:
dh $@
override_dh_auto_configure:
if ! command -v rustc >/dev/null 2>&1; then \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal; \
. $(HOME)/.cargo/env; \
fi
$(HOME)/.cargo/bin/rustup default stable || rustup default stable
override_dh_auto_build:
PATH="$(HOME)/.cargo/bin:$(PATH)" cargo build --release --locked
override_dh_auto_install:
install -D -m 0755 target/release/bssh debian/bssh/usr/bin/bssh
override_dh_auto_test:
PATH="$(HOME)/.cargo/bin:$(PATH)" cargo test --release --locked || true
override_dh_auto_clean:
rm -rf $(CARGO_TARGET_DIR) $(CARGO_HOME)
dh_auto_clean
override_dh_builddeb:
dh_builddeb --destdir=../