#!/usr/bin/make -f
export DH_GOLANG_INSTALL_EXTRA = docs/csv.md
export DH_GOLANG_EXCLUDES = scripts/

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

execute_after_dh_auto_test:
	# The test binary is placed in the source root after running the tests,
	# but we don't want to include it into the -dev package.
	rm _build/src/github.com/benhoyt/goawk/goawk

	# docs/csv.md is used when running tests, but we don't want to include
	# it in the package.
	rm _build/src/github.com/benhoyt/goawk/docs/csv.md

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
execute_before_dh_installman:
	scdoc < debian/goawk.scd > debian/tmp/goawk.1
endif
