Change snapper configuration location via Makefile

Update installation instructions.

Fixes #43.
This commit is contained in:
James Barnett
2017-06-03 18:42:21 -04:00
parent bfbcefbe31
commit f99fbbdafe
3 changed files with 23 additions and 0 deletions

View File

@@ -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)/

View File

@@ -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]

View File

@@ -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