#!/usr/bin/make -f

# NB: the /service modules contain a number of k8s related dependencies
# that are not (currently) packaged in debian for use by other packages.
# As of version 0.8.0, this excludes the programs containerd-stargz-grpc
# and stargz-core, which are excluded from building in the following
export DH_GOLANG_EXCLUDES := stargz-snapshotter/service stargz-snapshotter/cmd/containerd-stargz-grpc stargz-snapshotter/cmd/stargz-store


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

# exclude tests that reach out to internet #999440
override_dh_auto_test:
	# avoid more than 8 goroutines to avoid out of memory on 32bit architectures
	DH_GOLANG_EXCLUDES="nativeconverter $(DH_GOLANG_EXCLUDES)" GOMAXPROCS=8 dh_auto_test -v --max-parallel=2

