chiark / gitweb /
build: Install some more files to their eventual locations.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 19 Apr 2010 21:01:00 +0000 (22:01 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 19 Apr 2010 21:43:19 +0000 (22:43 +0100)
Install the base peers.in file as ${configdir}/peers.d/10base as a
convenience to users.  It's correct to clobber the user's old file,
since there's a fierce warning at the top of the file.  (Make the
warning more fierce.)

Install the startup script configuration file (but not the script
itself), only if there isn't one already.  This prevents us from
overwriting a user's customized configuration.

To prevent distcheck from failing, change the default of `initconfig' to
be ${sysconfdir}/tripe.conf; this is probably the right thing anyway.

configure.ac
init/Makefile.am
peerdb/Makefile.am
peerdb/peers.in

index ac12dbec2711df385225872940a5a9c108980fa6..3ad53dc8ab8ac93ddaa5bea196dac263c182a854 100644 (file)
@@ -89,8 +89,9 @@ TRIPE_DEFINE_PATH(
   [pidfile], [FILE], [process-id [[./tripectl.pid]]], [tripectl.pid])
 
 TRIPE_DEFINE_PATH(
-  [initconfig], [FILE], [configuration for init script [[/etc/tripe.conf]]],
-  [/etc/tripe.conf])
+  [initconfig], [FILE],
+  [configuration for init script [[SYSCONFDIR/tripe.conf]]],
+  ['${sysconfdir}/tripe.conf'])
 
 TRIPE_DEFINE_PATH(
   [logfile], [FILE], [logging output [[./tripe.log]]], [tripe.log])
index 50583a8ab3221f5d28b20e3c8289914665b938e3..e8d662d5852fb9a97c3901c29ed34393f22fd4c3 100644 (file)
@@ -42,9 +42,17 @@ tripe-init: tripe-init.in Makefile
 
 ## Configuration file for the script.
 EXTRA_DIST             += tripe.conf
+install-data-local:: tripe.conf
+       initconfig=$(initconfig) && dir=$${initconfig%/*} && \
+               $(MKDIR_P) $(DESTDIR)$$dir
+       test -f $(DESTDIR)$(initconfig) || \
+               $(INSTALL_SCRIPT) $(srcdir)/tripe.conf \
+                       $(DESTDIR)$(initconfig)
+uninstall-local::
+       rm -f $(DESTDIR)$(initconfig)
 
 ## Necessary directories.
-install-data-hook:
+install-data-hook::
        for i in "$(configdir)" "$(socketdir)"; do \
          case "$$i" in /*) $(MKDIR_P) $(DESTDIR)$$i ;; esac; \
        done
index 55477f4f36f7a25d5fbf1ee2b6e2a01d729ece47..c606474687f07eaee62db2a542d7a34dcf5816e5 100644 (file)
@@ -34,7 +34,6 @@ man_MANS               =
 sbin_SCRIPTS           += tripe-newpeers
 CLEANFILES             += tripe-newpeers
 EXTRA_DIST             += tripe-newpeers.in
-EXTRA_DIST             += peers.in
 
 tripe-newpeers: tripe-newpeers.in Makefile
        $(confsubst) $(srcdir)/tripe-newpeers.in >$@.new \
@@ -54,4 +53,14 @@ man_MANS             += tripe-newpeers.8
 CLEANFILES             += tripe-newpeers.8
 EXTRA_DIST             += tripe-newpeers.8.in
 
+## Install peer database sources.
+EXTRA_DIST             += peers.in
+
+install-data-local:: peers.in
+       $(MKDIR_P) $(DESTDIR)$(configdir)/peers.d
+       $(INSTALL_DATA) $(srcdir)/peers.in \
+               $(DESTDIR)$(configdir)/peers.d/10base
+uninstall-local::
+       rm -f $(DESTDIR)$(configdir)/peers.d/10base
+
 ###----- That's all, folks --------------------------------------------------
index 16acbc8e8c94f0faf26e6f6b88943b3778f49fc9..014390230a27c0a5794a48d4e00d292ebbcfc233 100644 (file)
@@ -2,8 +2,9 @@
 ;;;
 ;;; Peers description file
 ;;;
-;;; You're best off not editing this file at all; instead, drop a file
-;;; containing your overriden settings alongside.
+;;; New installations will clobber this file.  Therefore you're best off not
+;;; editing this file directly; instead, drop a file containing your
+;;; overridden settings alongside.
 
 ;;;--------------------------------------------------------------------------
 ;;; Global defaults.