From: Mark Wooding Date: Mon, 19 Apr 2010 21:01:00 +0000 (+0100) Subject: build: Install some more files to their eventual locations. X-Git-Tag: 1.0.0pre8~9 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/288fc12b89f5557829a4bedbc65a648c324de4a6 build: Install some more files to their eventual locations. 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. --- diff --git a/configure.ac b/configure.ac index ac12dbec..3ad53dc8 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/init/Makefile.am b/init/Makefile.am index 50583a8a..e8d662d5 100644 --- a/init/Makefile.am +++ b/init/Makefile.am @@ -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 diff --git a/peerdb/Makefile.am b/peerdb/Makefile.am index 55477f4f..c6064746 100644 --- a/peerdb/Makefile.am +++ b/peerdb/Makefile.am @@ -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 -------------------------------------------------- diff --git a/peerdb/peers.in b/peerdb/peers.in index 16acbc8e..01439023 100644 --- a/peerdb/peers.in +++ b/peerdb/peers.in @@ -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.