#!/usr/bin/make -f

export DH_GOPKG := go.opentelemetry.io/contrib
export DH_GOLANG_INSTALL_ALL := 1
# Exclude packages to avoid additional dependencies
export DH_GOLANG_EXCLUDES := \
	otelgrpc/example/client \
	propagators	detectors exporters \
	instrumentation/github.com \
	instrumentation/go.mongodb.org \
	instrumentation/gopkg.in \
	instrumentation/host \
	instrumentation/runtime

%:
	dh $@ --buildsystem=golang --with=golang

# The instrumentation/google.golang.org doesn't include
# tests, so we don't need to run them...
override_dh_auto_test:
	@echo "Disabled tests for now"

# We only need the -dev package, we don't want client/server cmds in /usr/bin.
override_dh_auto_install:
	dh_auto_install
	rm -rf $(CURDIR)/debian/golang-opentelemetry-contrib-dev/usr/bin
	rm -rf $(CURDIR)/debian/golang-opentelemetry-contrib-dev/usr/share/gocode/src/go.opentelemetry.io/contrib/.gitattributes
	rm -rf $(CURDIR)/debian/golang-opentelemetry-contrib-dev/usr/share/gocode/src/go.opentelemetry.io/contrib/.gitignore
