[Box Backup-dev] [Patch] Set config dir using configure
James O'Gorman
boxbackup-dev@fluffy.co.uk
Thu, 5 Jul 2007 23:06:57 +0100
--3uo+9/B/ebqu+fSQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Does anyone object to me committing the attached patch? It means we now
handle PREFIX properly for the config dir, although packagers for Linux
distributions and OpenBSD may want to set --sysconfdir=/etc.
James
--3uo+9/B/ebqu+fSQ
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="configdir.patch"
Index: configure.ac
===================================================================
--- configure.ac (revision 1713)
+++ configure.ac (working copy)
@@ -222,10 +222,12 @@
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
bindir_expanded=`eval "echo $bindir"`
bindir_expanded=`eval "echo $bindir_expanded"`
+box_configdir=`eval echo ${sysconfdir}/box`
prefix=$saved_prefix
exec_prefix=$saved_exec_prefix
AC_SUBST([bindir_expanded])
+AC_DEFINE_UNQUOTED([BOX_CONFIGDIR], ["$box_configdir"], [Location of config files (e.g. PREFIX/etc)])
### Output files
AC_CONFIG_FILES([infrastructure/BoxPlatform.pm])
Index: lib/common/BoxPortsAndFiles.h
===================================================================
--- lib/common/BoxPortsAndFiles.h (revision 1713)
+++ lib/common/BoxPortsAndFiles.h (working copy)
@@ -15,7 +15,7 @@
// Backup store daemon
#define BOX_PORT_BBSTORED (BOX_PORT_BASE+1)
-#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "/etc/box/bbstored.conf"
+#define BOX_FILE_BBSTORED_DEFAULT_CONFIG BOX_CONFIGDIR "/bbstored.conf"
// directory within the RAIDFILE root for the backup store daemon
#define BOX_RAIDFILE_ROOT_BBSTORED "backup"
@@ -23,11 +23,11 @@
#ifdef WIN32
#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "C:\\Program Files\\Box Backup\\bbackupd.conf"
#else
-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "/etc/box/bbackupd.conf"
+#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG BOX_CONFIGDIR "/bbackupd.conf"
#endif
// RaidFile conf location default
-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "/etc/box/raidfile.conf"
+#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG BOX_CONFIGDIR "/raidfile.conf"
// Default name of the named pipe
#define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup"
--3uo+9/B/ebqu+fSQ--