#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

# Override default hooks path (see _doc/PACKAGING-PATHS.md)
GO_LDFLAGS += -X github.com/hlandau/acmetool/hooks.DefaultPath=/etc/acme/hooks
# Set version information for acmetool --version
GO_LDFLAGS += -X github.com/hlandau/buildinfo.RawBuildInfo=$(shell echo -n 'acmetool $(DEB_VENDOR) version $(DEB_VERSION)' | base64)

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

override_dh_auto_build:
	dh_auto_build -- -ldflags "$(GO_LDFLAGS)"

override_dh_auto_install:
	dh_auto_install -- --no-source
	mkdir -p debian/acmetool/usr/share/man/man8
	debian/acmetool/usr/bin/acmetool --help-man > debian/acmetool/usr/share/man/man8/acmetool.8

override_dh_compress:
	dh_compress --exclude=examples

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start acmetool.timer

override_dh_installinit:
