#!/usr/bin/make -f

VERSION := v$(shell dpkg-parsechangelog -SVersion | sed 's/[~+]ds.*//; s/-.*//; s/~/-/g')+debian

DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)

override_dh_auto_build:
	dh_auto_build -- -ldflags '-X github.com/docker/distribution/version.Version=$(VERSION)'

override_dh_auto_test:
	# health/checks hit the internet, and thus fail
	#DH_GOLANG_EXCLUDES='distribution/registry/handlers health/checks' dh_auto_test -- -test.short

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