#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := specsuite

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

# Avoid shipping some files:
override_dh_auto_install:
	# /usr/bin would get: hcldec, hclfmt, and hclspecsuite
	dh_auto_install -- --no-binaries
	chmod -v -x debian/tmp/usr/share/gocode/src/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go
	# hashicorp/hcl/v2/specsuite/ would get:
	find debian/tmp \
		\( -name 'tmp_hcldec' -o -name 'tmp_hclspecsuite' -o -name '.gitignore' \) \
		-print -delete

# TestExpandMarkedForEach panics ("value is marked, so must be unmarked
# first") with go-cty-debug before upstream commit 0d6042c (2024-05-09);
# Debian has 0.0~git20191215.b22d67c. Drop once go-cty-debug is updated.
override_dh_auto_test:
	dh_auto_test -- -skip 'TestExpandMarkedForEach'
