#!/usr/bin/make -f

# Skip the examples in source (they're in doc)
export DH_GOLANG_EXCLUDES := examples

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

# disable tests for now, most require root and a working lxc setup.
# Some don't, and there are provision to skip the one that do,
# but the build system is using fakeroot, so it fails.
# Also, even without root a proper lxc + cgroups setup is needed
override_dh_auto_test:
	echo "The testsuite requires a working LXC setup."

# Prevent excluded targets to be included in code
override_dh_auto_install:
	dh_auto_install
	# Do not install excluded packages.
	for pkg in $(DH_GOLANG_EXCLUDES); do \
	    rm -rf debian/*/usr/share/gocode/src/gopkg.in/lxc/go-lxc.v2/$$pkg;\
	    done
