#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := \
	$(wildcard internal/tools/semconvkit/templates/*.tmpl) \
	$(wildcard internal/tools/semconvkit/templates/*/*.tmpl) \

# autopkgtest.ubuntu.com exports these variable and causes the tests hanging
unexport https_proxy
unexport http_proxy

%:
	dh $@ --builddirectory=_build

# https://github.com/open-telemetry/opentelemetry-go/issues/6476
# internal/global failed to setup with disable-sdk-auto.patch
override_dh_auto_test:
	DH_GOLANG_EXCLUDES="$(DH_GOLANG_EXCLUDES) internal/global" \
	dh_auto_test $(DH_BUILD_OPTS) -- \
		-skip=TestTraceProviderDelegatesSameInstance

override_dh_fixperms:
	dh_fixperms
	# Drop executable bits to make lintian happy
	find debian/$(SOURCE_NAME) -type f -executable -not -name "*.sh" -exec chmod -x {} +
