#!/usr/bin/make -f
DEB_UPDATE_RCD_PARAMS := "defaults 30"

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

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_CONFIGURE_EXTRA_FLAGS += --with-idldir=/usr/share/idl/fred/ --with-monitoring-hosts-file=/etc/fred/monitoring_hosts.conf

makebuilddir/fred-pifd::
	autoreconf -vfi
makebuilddir/fred-rifd::
	autoreconf -vfi
makebuilddir/fred-adifd::
	autoreconf -vfi
makebuilddir/fred-logd::
	autoreconf -vfi
makebuilddir/fred-mifd::
	autoreconf -vfi
makebuilddir/fred-dbifd::
	autoreconf -vfi


#install/fred-pifd::
#	install -m 640 $(CURDIR)/debian/fred-pifd.event.d $(CURDIR)/debian/fred-pifd/etc/event.d/fred-pifd
#
#install/fred-rifd::
#	install -m 640 $(CURDIR)/debian/fred-rifd.event.d $(CURDIR)/debian/fred-rifd/etc/event.d/fred-rifd
#
#install/fred-adifd::
#	install -m 640 $(CURDIR)/debian/fred-adifd.event.d $(CURDIR)/debian/fred-adifd/etc/event.d/fred-adifd
#
#install/fred-logd::
#	install -m 640 $(CURDIR)/debian/fred-logd.event.d $(CURDIR)/debian/fred-logd/etc/event.d/fred-logd
#
install/fred-mifd::
	#install -m 640 $(CURDIR)/debian/fred-mifd.event.d $(CURDIR)/debian/fred-mifd/etc/event.d/fred-mifd
	install -m 755 $(CURDIR)/debian/sms_send_tomato.bash $(CURDIR)/debian/fred-mifd/usr/share/fred/util/sms_send_tomato
	install -m 755 $(CURDIR)/debian/sms_send_tomato.conf $(CURDIR)/debian/fred-mifd/etc/fred/sms_send_tomato.conf
	install -m 755 $(CURDIR)/debian/sms_send_mobilcz.bash $(CURDIR)/debian/fred-mifd/usr/share/fred/util/sms_send_mobilcz
	install -m 755 $(CURDIR)/debian/sms_send_mobilcz.conf $(CURDIR)/debian/fred-mifd/etc/fred/sms_send_mobilcz.conf
	install -m 755 $(CURDIR)/debian/sms_send_klikniavolej.bash $(CURDIR)/debian/fred-mifd/usr/share/fred/util/sms_send_klikniavolej
	install -m 755 $(CURDIR)/debian/sms_send_klikniavolej.conf $(CURDIR)/debian/fred-mifd/etc/fred/sms_send_klikniavolej.conf

#install/fred-msgd::
#	install -m 640 $(CURDIR)/debian/fred-msgd.event.d $(CURDIR)/debian/fred-msgd/etc/event.d/fred-msgd
