[Pkg-ganeti-devel] Implement GANETI export and os directory using autoconf

Leonardo Rodrigues de Mello l at lmello.eu.org
Tue Sep 25 15:19:03 UTC 2007


Hi,

I had make this patch to allow ganeti export and os image to use a
configuration parameter passed on build time, using
--with-ganeti-srv-dir.

Index: configure.ac
===================================================================
--- configure.ac        (revisão 181)
+++ configure.ac        (cópia de trabalho)
@@ -14,6 +14,15 @@
   [ssh_initd_script="/etc/init.d/ssh"])
 AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script)

+# --with-ganeti-srv-dir=...
+AC_ARG_WITH([ganeti-srv-dir],
+  [AS_HELP_STRING([--with-ganeti-srv-dir],
+    [Directory that will be used to store ganeti exports and os
scripts (default is /srv/ganeti)]
+  )],
+  [ganeti-srv-dir="$withval"],
+  [ganeti-srv-dir="/srv/ganeti"])
+AC_SUBST(GANETI_SRV_DIR, $ganeti-srv-dir)
+
 # Check common programs
 AC_PROG_INSTALL

Index: lib/constants.py
===================================================================
--- lib/constants.py    (revisão 181)
+++ lib/constants.py    (cópia de trabalho)
@@ -49,8 +49,9 @@
 LOG_OS_DIR = LOG_DIR + "/os"
 LOG_NODESERVER = LOG_DIR + "/node-daemon.log"

-OS_DIR = "/srv/ganeti/os"
-EXPORT_DIR = "/srv/ganeti/export"
+GANETI_SRV_DIR = _autoconf.GANETI_SRV_DIR
+OS_DIR = GANETI_SRV_DIR + "/os"
+EXPORT_DIR = GANETI_SRV_DIR + "/export"

 EXPORT_CONF_FILE = "config.ini"

Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am     (revisão 181)
+++ lib/Makefile.am     (cópia de trabalho)
@@ -1,4 +1,5 @@
 SSH_INITD_SCRIPT = @SSH_INITD_SCRIPT@
+GANETI_SRV_DIR = @GANETI_SRV_DIR@

 CLEANFILES = $(nodist_pkgpython_PYTHON) *.py[oc]

@@ -16,4 +17,5 @@
          echo "LOCALSTATEDIR = '$(localstatedir)'"; \
          echo "SYSCONFDIR = '$(sysconfdir)'"; \
          echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
+         echo "GANETI_SRV_DIR = '$(GANETI_SRV_DIR)'"; \
        } > $@


-- 
Leonardo Rodrigues de Mello
jabber: l at lmello.eu.org



More information about the Pkg-ganeti-devel mailing list