#!/usr/bin/make -f
# -*- makefile -*-

export DH_GOPKG := launchpad.net/ubuntu-push
export UBUNTU_PUSH_TEST_RESOURCES_ROOT := $(CURDIR)

override_dh_auto_build:
	dh_auto_build --buildsystem=golang
	(cd signing-helper && cmake . && make)

# overriding dh_auto_test because the http13client tests don't all pass on go < 1.3
# (should go away once we ship go 1.3)
override_dh_auto_test:
	cd $$( find ./ -type d -regex '\./[^/]*/src/launchpad.net' -printf "%h\n" | head -n1) && \
	env GOPATH=$$(cd ..; pwd) go test -v $$(env GOPATH=$$(cd ..; pwd) go list $(DH_GOPKG)/... | grep -v acceptance | grep -v http13client )

override_dh_install:
	dh_install -Xusr/bin/cmd --fail-missing

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