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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

basedir := $(shell pwd)

override_dh_auto_test:
	# do nothing

override_dh_auto_configure:
	./configure --prefix=/opt/openitc/nagios --enable-event-broker --with-nagios-group=www-data --with-lockfile=/opt/openitc/nagios/var/nagios.lock

override_dh_auto_clean:
	dh_auto_clean
	rm -f config.log lib/snprintf.h t/Makefile t/var/status-generated.dat

override_dh_auto_build:
	$(MAKE) all

override_dh_auto_install:
	# zero out INSTALL_OPTS and COMMAND_OPTS to prevent chown during debuild
	$(MAKE) install INSTALL_OPTS="" COMMAND_OPTS="" DESTDIR=${basedir}/debian/openitcockpit-nagios AM_UPDATE_INFO_DIR=no
	$(MAKE) install INSTALL_OPTS="" COMMAND_OPTS="" DESTDIR=${basedir}/debian/openitcockpit-nagios-sat AM_UPDATE_INFO_DIR=no

	dh_installdirs
	dh_install

%:
	dh $@  --with autotools-dev
