#!/usr/bin/make -f

export BUILD_DATE = $(shell LC_ALL=C date -u --date="`dpkg-parsechangelog -SDate`" +'%b %e %Y %H:%M:%S')

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@

override_dh_auto_build:
	# NOTE: settting things to "" makes analog look for config files
	# in the current directory if no path is specified. See anlghead.h
	$(MAKE) DEFS='-DHOSTNAME=\"Debian\ Linux\ System\" \
		-DHOSTURL=\"/\" \
		-DLOGSDIR=\"/var/log/apache/\" \
		-DLOGFILE=\"access.log\" \
		-DIMAGEDIR=\"/analog/\" \
		-DLANGDIR=\"/usr/share/analog/lang/\" \
		-DCACHEDIR=\"/var/cache/analog/\" \
		-DDNSDIR=\"/var/cache/analog/dns/\" \
		-DCONFIGDIR=\"\" \
		-DOUTDIR=\"\" \
		-DERRDIR=\"\" \
		-DHEADERDIR=\"\" \
		-DLOCKDIR=\"/var/lock/\" \
		-DDEFAULTCONFIGFILE=\"/etc/analog.cfg\"' \
		analog

# nothing to do
override_dh_auto_install:

override_dh_installdocs:
	dh_installdocs -X Licence.txt
