#!/usr/bin/make -f

HUGO := obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)/bin/hugo

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

# Disable network access during testing by using -test.short flag
override_dh_auto_test:
	dh_auto_test -O--buildsystem=golang -- -test.short

override_dh_auto_build:
	dh_auto_build -O--buildsystem=golang
	$(HUGO) gen autocomplete --completionfile=debian/hugo.bash-completion
	$(HUGO) gen man --dir=debian/man
	# TODO: Add "hugo-docs" package in the future
	$(HUGO) -s docs -d public/html --uglyURLs

override_dh_auto_install:
	dh_auto_install -O--buildsystem=golang
	dh_bash-completion -O--buildsystem=golang
