#!/usr/bin/make -f

pristine-testdata:
	rsync -a --delete testdata/ '$(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/src/github.com/constabulary/gb/testdata/'
	rsync -a --delete fileutils/_testdata/ '$(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/src/github.com/constabulary/gb/fileutils/_testdata/'
	rsync -a --delete vendor/_testdata/ '$(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/src/github.com/constabulary/gb/vendor/_testdata/'

override_dh_auto_test:
	./debian/rules pristine-testdata
	
	# some tests need network access (gated by -short), so we run those only via DEP8
	dh_auto_test -- -short

override_dh_auto_install:
	# re-copy pristine testdata so we delete garbage created by build/test
	./debian/rules pristine-testdata
	
	dh_auto_install

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