Allow customization of installation directory
authorIustin Pop <iustin@google.com>
Mon, 7 Jul 2008 08:54:00 +0000 (08:54 +0000)
committerIustin Pop <iustin@google.com>
Mon, 7 Jul 2008 08:54:00 +0000 (08:54 +0000)
Currently the OS definition is installed always under
$datadir/ganeti/os, but this doesn't work if ganeti was configure with a
different OS dir.

This patch allows customization of the os dir at configure time, via a
new '--with-os-dir=...' variable. This allows for example:
  ./configure --with-os-dir=/srv/ganeti/os ...

Reviewed-by: imsnah

Makefile.am
configure.ac

index 1b6050f..aed3fc2 100644 (file)
@@ -1,6 +1,6 @@
 osname=$(subst ganeti-instance-,,$(PACKAGE))
 
-osdir=$(datadir)/ganeti/os/$(osname)
+osdir=$(OS_DIR)/$(osname)
 
 os_SCRIPTS = create
 dist_os_SCRIPTS = import export rename
index 570deb0..56f9fbb 100644 (file)
@@ -6,6 +6,16 @@ AC_CONFIG_SRCDIR(configure)
 
 AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
 
+# --with-os-dir=...
+AC_ARG_WITH([os-dir],
+  [AS_HELP_STRING([--with-os-dir=DIR],
+    [top-level OS directory under which to install]
+    [ (default is $datadir/ganeti/os)]
+  )],
+  [os_dir="$withval"],
+  [os_dir="$datadir/ganeti/os"])
+AC_SUBST(OS_DIR, $os_dir)
+
 # Check common programs
 AC_PROG_INSTALL
 AC_PROG_LN_S