#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

override_dh_auto_configure:
	 dh_auto_configure -- --sysconfdir=/etc/dsh

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) distclean

override_dh_auto_install:
	# Add here commands to install the package into debian/dsh.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/dsh
	cp $(CURDIR)/debian/machines.list $(CURDIR)/debian/dsh/etc/dsh/machines.list
	cp $(CURDIR)/dsh.conf $(CURDIR)/debian/dsh/etc/dsh/dsh.conf
	install -d $(CURDIR)/debian/dsh/usr/lib/update-cluster
	install -m 755 $(CURDIR)/debian/dsh.updatelist $(CURDIR)/debian/dsh/usr/lib/update-cluster/
	install -d $(CURDIR)/debian/dsh/usr/share/bash-completion/completions/
	install -m 644 $(CURDIR)/debian/dsh.bash_completion $(CURDIR)/debian/dsh/usr/share/bash-completion/completions/dsh

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

%:
	dh $@
