#!/usr/bin/make -f
# See debhelper(7) for more info

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

%:
	dh $@

DESTDIR = $(CURDIR)/debian/sanoid
override_dh_auto_install:
	install -d $(DESTDIR)/etc/sanoid
	install -m 664 sanoid.defaults.conf $(DESTDIR)/etc/sanoid

	install -d $(DESTDIR)/usr/sbin
	install -m 775 \
		findoid sanoid sleepymutex syncoid \
		$(DESTDIR)/usr/sbin

	install -d $(DESTDIR)/usr/share/doc/sanoid
	install -m 664 sanoid.conf \
		$(DESTDIR)/usr/share/doc/sanoid/sanoid.conf.example

	dh_installsystemd --name sanoid-prune

override_dh_installinit:
	dh_installinit --noscripts

override_dh_systemd_enable:
	dh_systemd_enable sanoid.timer
	dh_systemd_enable sanoid-prune.service

override_dh_systemd_start:
	dh_systemd_start sanoid.timer
