#!/usr/bin/make -f

%:
	dh $@ --with apache2

export DESTDIR = $(CURDIR)/debian/pgcluu

override_dh_auto_configure:
	perl ./tools/updt_embedded_rsc.pl
	dh_auto_configure

override_dh_auto_install:
	dh_auto_install
	# remove bogus directories
	rm -rfv debian/pgcluu/bin debian/pgcluu/var/run

override_dh_installsystemd:
	# only enable data collection by default; pgcluu.service is not needed if the CGI is used
	dh_installsystemd --no-enable pgcluu.service
	dh_installsystemd --no-enable pgcluu.timer
	dh_installsystemd pgcluu_collectd.service
	# move unit files to /usr on systems that support it
	if test -x /usr/bin/dh_movetousr; then dh_movetousr; fi
