# Paths
prefix  ?= /usr
sbindir ?= $(prefix)/sbin
bindir  ?= $(prefix)/bin
mandir  ?= $(prefix)/share/man
docdir  ?= $(prefix)/share/doc/zfs-transfer-utils
sysconfdir ?= /etc

sudodir ?= $(sysconfdir)/sudoers.d

# Programs to be installed
SBINFILES = zfs-transfer-send zfs-transfer-receive zfs-transfer-cron zfs-transfer-clean
BINFILES  = zfs-transfer-shell 

all:

install:
	install -v -m 0700 -o root -g root -D -t $(DESTDIR)/$(sbindir) $(SBINFILES)
	install -v -m 0755 -o root -g root -D -t $(DESTDIR)/$(bindir)  $(BINFILES)
	install -v -m 0644 -o root -g root -D -t $(DESTDIR)/$(mandir)/man8  man/*.8
	@echo "========================================================================="
	@echo "zfs-transfer-utils has been installed."
	@echo
	@echo "Remember to create a zfs transfer account and set up its 'sudo' access."
	@echo
	@echo "You'll find an example sudoers.d config file in this source distribution."
	@echo "========================================================================="
