#!/usr/bin/make -f

#export DH_VERBOSE = 1

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

execute_after_dh_auto_install:
	rm -r debian/golang-github-iovisor-gobpf-dev/usr/bin

execute_before_dh_auto_configure: copyright-scan

copyright-scan:
	scan-copyrights >debian/$@.new.tmp 2>debian/$@.new.todo.tmp
	( \
		sed -e 's/^/# /' -e '/You may want to add a line in/q' debian/$@.new.todo.tmp; \
		echo; \
		cat debian/$@.new.tmp; \
	) | grep -v "Note: loading debian/fill.copyright.blanks.yml" >debian/$@.new >debian/$@.new
	diff -u debian/$@ debian/$@.new
	rm debian/$@.new*

copyright-update: copyright-scan
	cme update -q dpkg-copyright

.PHONY: copyright-scan copyright-update
