diff --git a/Makefile b/Makefile index e7098e6..76014ba 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ PKGNAME = snap-sync PREFIX ?= /usr +SNAPPER_CONFIG ?= /etc/sysconfig/snapper BIN_DIR = $(DESTDIR)$(PREFIX)/bin SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system @@ -24,5 +25,6 @@ SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system .PHONY: install install: + sed -i 's@^SNAPPER_CONFIG.*@SNAPPER_CONFIG='$(SNAPPER_CONFIG)'@g' bin/$(PKGNAME) @install -Dm755 bin/* -t $(BIN_DIR)/ @install -Dm644 systemd/* -t $(SYSTEMD_DIR)/ diff --git a/README.md b/README.md index 7fc3a93..2e5ca02 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,25 @@ have to be sent. snapper is required. +## Installation + +Run: + + # make install + +By default it will look for the snapper configuration file at +`/etc/sysconfig/snapper`. To change this pass `SNAPPER_CONFIG` to make +with the location of the configuration file. For example, with Ubuntu +you will want to install: + + # make SNAPPER_CONFIG=/etc/default/snapper install + +For Arch Linux it would be: + + # make SNAPPER_CONFIG=/etc/conf.d/snapper install + +The package is available in the [AUR](https://aur.archlinux.org/packages/snap-sync/). + ## Options Usage: snap-sync [options] diff --git a/bin/snap-sync b/bin/snap-sync index f774bd0..3caf71c 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -12,6 +12,8 @@ set -o errtrace version="0.4" name="snap-sync" +SNAPPER_CONFIG=/etc/sysconfig/snapper + TMPDIR=$(mktemp -d) PIPE=$TMPDIR/$name.out mkfifo $PIPE