#!/usr/bin/make -f
# -*- makefile -*-

export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS = noopt

CFLAGS += -DSYSLOG -ggdb
CXXFLAGS += -DSYSLOG -ggdb
CPPFLAGS += -DSYSLOG

%:
	dh $@ --with autoreconf,systemd --buildsystem=autoconf --parallel

override_dh_auto_configure:
	dh_auto_configure -- --with-idldir=/usr/share/idl/fred/ --with-monitoring-hosts-file=/etc/fred/monitoring_hosts.conf

#override_dh_auto_test:
#	# skip tests, they take too long


override_dh_install:
	install -m 755 $(CURDIR)/debian/sms_send_tomato.bash $(CURDIR)/debian/fred-mifd/usr/share/fred/util/sms_send_tomato
	install -m 644 $(CURDIR)/debian/sms_send_tomato.conf $(CURDIR)/debian/fred-mifd/etc/fred/sms_send_tomato.conf
	install -m 755 $(CURDIR)/debian/sms_send_klikniavolej.bash $(CURDIR)/debian/fred-mifd/usr/share/fred/util/sms_send_klikniavolej
	install -m 644 $(CURDIR)/debian/sms_send_klikniavolej.conf $(CURDIR)/debian/fred-mifd/etc/fred/sms_send_klikniavolej.conf
	dh_install

# https://lists.debian.org/debian-mentors/2015/09/msg00606.html
override_dh_installinit:
	dh_installinit --noscripts
