#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := x509roots/fallback/bundle/bundle.der

%:
	dh $@ --builddirectory=_build --buildsystem=golang

execute_after_dh_auto_configure:
	cp -av $(CURDIR)/debian/go/src _build/src/golang.org/x/crypto/vendor

override_dh_auto_install:
	dh_auto_install -- --no-binaries

# Modern openssh trigger this failure, do we need to enable forwarding somehow?
# OK 10.0p1-8 FAIL 10.2p1-1
# === RUN   TestAgentForward
#     agent_unix_test.go:41: RequestAgentForwarding: forwarding request denied
# OK 0.56.0 1:10.5p1-1 FAIL 0.57.0 1:10.6p1-1
# === RUN   TestClientAuthDisconnect
#    session_test.go:322: unexpected call to PasswordCallback()
SKIP_TESTS="TestAgentForward|TestClientAuthDisconnect"

override_dh_auto_test:
	dh_auto_test $(DH_BUILD_OPTS) -- -skip $(SKIP_TESTS)
	-timeout 5m dh_auto_test $(DH_BUILD_OPTS) -- -run $(SKIP_TESTS)
