#!/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 # Prevent TestImageResize8BitPNG from failing due to pkgbinarymangler # recompressing our test PNG image on Ubuntu export NO_PNG_PKG_MANGLE := 1 DATE_FMT = %Y-%m-%dT%H:%M:%S%z ifdef SOURCE_DATE_EPOCH BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)") else BUILD_DATE ?= $(shell date "+$(DATE_FMT)") endif BUILD_DATE := $(BUILD_DATE:+0000=Z) %: dh $@ --buildsystem=golang --with=golang override_dh_auto_build: dh_auto_build -O--buildsystem=golang -- -ldflags '-X github.com/gohugoio/hugo/common/hugo.buildDate=$(BUILD_DATE)' -tags 'dev extended' $(HUGO) version $(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 -timeout 30m override_dh_auto_install: dh_auto_install -O--buildsystem=golang dh_bash-completion -O--buildsystem=golang