#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk # DEB_VERSION

export DH_GOLANG_EXCLUDES := pkg/providers/buildkite

export DH_GOLANG_INSTALL_EXTRA := \
	$(wildcard pkg/policy/testdata/*/*)

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

execute_before_dh_auto_build:
	rm -rfv _build/src/github.com/sigstore/cosign/v2/pkg/cosign/rego

override_dh_auto_install:
	dh_auto_install -- --no-binaries
	rm -fv $(CURDIR)/debian/*/usr/share/gocode/src/github.com/sigstore/cosign/v2/test/testdata/test.wasm

SKIP="TestImportOfKeys|TestLoadCertsKeylessVerification|TestGetCTLogPubKeys|TestImportPrivateKey|TestVerifyEmbeddedSCT|TestValidateAndUnpackCertWithSCT|TestEvalPolicy|TestGetRekorPubKeys"
override_dh_auto_test:
	-dh_auto_test $(DH_BUILD_OPTS) -- -run=$(SKIP)
	dh_auto_test $(DH_BUILD_OPTS) -- -skip=$(SKIP)
