#!/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:
	autoreconf -s -i || autoreconf -s -i
	./configure --prefix=/opt/openitc/nagios --with-naemon-user=nagios --with-naemon-group=www-data

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_usrlocal:
        # do nothing

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-naemon AM_UPDATE_INFO_DIR=no 
	
	dh_installdirs
	dh_install

%:
	dh $@  --with autotools-dev
