#!/usr/bin/make -f

HUGO := obj-$(DEB_HOST_GNU_TYPE)/bin/hugo

export DH_GOLANG_INSTALL_EXTRA := hugolib/testdata resource/testdata parser/long_text_test.md

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

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

# Disable network access during testing by using -test.short flag,
# and skip Git tests which upstream has also disabled for Travis CI.
override_dh_auto_test:
	CI=true dh_auto_test -O--buildsystem=golang -- -test.short

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