chiark / gitweb /
@@ -1,4 +1,4 @@
[chiark-utils.git] / backup / Makefile
index 16260e6e5c1d2b154ddfebd057faee67603fa119..3b559574b17cbc30c356abf09c6738a99e60030e 100644 (file)
@@ -32,11 +32,15 @@ DEBUG=              -g
 RWBUFFER_SIZE_MB=16
 
 prefix=/usr/local
 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
 bindir=$(prefix)/bin
 sharedir=$(prefix)/share/chiark-backup
-txtdocdir=$(prefix)/share/doc/chiark-backup/examples
+txtdocdir=$(prefix)/share/doc/chiark-backup
 exampledir=$(txtdocdir)/examples
 exampledir=$(txtdocdir)/examples
+vardir=$(varlib)/chiark-backup
 
 INSTALL=               install -c
 INSTALL_SHARE=         $(INSTALL) -m 644 -o root -g root
 
 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
 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
                $(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 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
 
                        cd ../..; \
                done