chiark / gitweb /
@@ -1,4 +1,4 @@
[chiark-utils.git] / backup / Makefile
index aefb18619f975255fc94cc96129fc395b79b20e4..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,19 +62,26 @@ 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_SHARE) $(SHAREFILES) $(sharedir)
                $(INSTALL_SCRIPT) $(SHARESCRIPTS) $(sharedir)
 
                $(INSTALL_PROGRAM) $(CTARGETS) $(bindir)
                set -e; for s in $(BINSCRIPTS); do \
                        $(INSTALL_SCRIPT) $$s $(bindir)/backup-$$s; done
                $(INSTALL_SHARE) $(SHAREFILES) $(sharedir)
                $(INSTALL_SCRIPT) $(SHARESCRIPTS) $(sharedir)
 
+install-docs:
+               $(INSTALL_DIRECTORY) $(txtdocdir)
+               $(INSTALL_SHARE) iwjbackup.txt $(txtdocdir)/README
+
 install-examples:
                set -e; for e in $(EXAMPLES); do \
                        cd examples/$$e; \
                        $(INSTALL_DIRECTORY) $(exampledir)/$$e; \
                        $(INSTALL_SHARE) [^A-Z]*[^~] $(exampledir)/$$e; \
 install-examples:
                set -e; for e in $(EXAMPLES); do \
                        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