chiark / gitweb /
@@ -1,4 +1,4 @@
[chiark-utils.git] / backup / Makefile
index 16260e6..3b55957 100644 (file)
@@ -32,11 +32,15 @@ DEBUG=              -g
 RWBUFFER_SIZE_MB=16
 
 prefix=/usr/local
-etcdir=/etc/chiark-backup
+etcdir=/etc
+varlib=/var/lib
+
+confdir=$(etcdir)/chiark-backup
 bindir=$(prefix)/bin
 sharedir=$(prefix)/share/chiark-backup
-txtdocdir=$(prefix)/share/doc/chiark-backup/examples
+txtdocdir=$(prefix)/share/doc/chiark-backup
 exampledir=$(txtdocdir)/examples
+vardir=$(varlib)/chiark-backup
 
 INSTALL=               install -c
 INSTALL_SHARE=         $(INSTALL) -m 644 -o root -g root
@@ -58,7 +62,7 @@ writebuffer:                          writebuffer.o rwbuffer.o
 readbuffer.o writebuffer.o rwbuffer.o: rwbuffer.h
 
 install:               all
-               $(INSTALL_DIRECTORY) $(etcdir) $(bindir) $(sharedir)
+               $(INSTALL_DIRECTORY) $(confdir) $(bindir) $(sharedir) $(vardir)
                $(INSTALL_PROGRAM) $(CTARGETS) $(bindir)
                set -e; for s in $(BINSCRIPTS); do \
                        $(INSTALL_SCRIPT) $$s $(bindir)/backup-$$s; done
@@ -74,7 +78,10 @@ install-examples:
                        cd examples/$$e; \
                        $(INSTALL_DIRECTORY) $(exampledir)/$$e; \
                        $(INSTALL_SHARE) [^A-Z]*[^~] $(exampledir)/$$e; \
-                       (cd $(exampledir) && tar -xf -) <SYMLINKS.tar; \
+                       if test -f SYMLINKS.tar; then \
+                               exec <SYMLINKS.tar; \
+                               (set -e; cd $(exampledir) && tar -xf -); \
+                       fi; \
                        cd ../..; \
                done