#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
export GOFLAGS := -ldflags=-X=main.Version=$(DEB_VERSION)

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

ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	cd doc/man && bash create_manpage.sh
endif

override_dh_auto_test:
	# Only run tests which do not boot a machine at build time
	# The other tests boot a machine using the host kernel, which buildds
	# do not have installed, and some tests require network access
	dh_auto_test -- -run '^Test(Zstd|Xz|Gzip|Null)$$'
