#!/usr/bin/make -f

%:
	dh $@ --builddirectory=debian/_build --buildsystem=golang

# this hack works around cyclic dependencies between these two packages.
# zdfs is tiny, and easy to ship here
execute_after_dh_auto_configure:
	mkdir -pv debian/_build/src/github.com/data-accelerator/zdfs
	cp -v debian/zdfs/* debian/_build/src/github.com/data-accelerator/zdfs

execute_after_dh_auto_install:
	mkdir -pv debian/tmp/usr/share/gocode/src/github.com/data-accelerator/zdfs
	cp -v debian/zdfs/*.go debian/tmp/usr/share/gocode/src/github.com/data-accelerator/zdfs
	# rename the ctr binary, cf. #1133166
	mv -v debian/tmp/usr/bin/ctr debian/tmp/usr/bin/ctr.accelerated-container-image
