#!/usr/bin/make -f
#export DH_VERBOSE = 1


export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND =

include /usr/share/dpkg/pkg-info.mk

export VERSION := v$(DEB_VERSION_UPSTREAM)
export PREFIX := /usr
export SYSTEMDUNITDIR := $(shell pkgconf --variable=systemdsystemunitdir systemd)


%:
	dh $@

execute_after_dh_auto_clean:
	rm -rf .cache

override_dh_auto_test:
	go version | grep -qF gcc || HOME=$$PWD go test -v

execute_after_dh_auto_install:
	+$(MAKE) install-initscript DESTDIR=debian/earlyoom

override_dh_installinit:
	dh_installinit --onlyscripts
