File 0001-build-offer-with-rundir-configure-argument.patch of Package ctdb

From e1819b1a20694632a1d77bb12a67fd24131886f7 Mon Sep 17 00:00:00 2001
From: David Disseldorp <ddiss@suse.de>
Date: Fri, 13 Jun 2014 16:46:47 +0200
Subject: [PATCH 1/2] build: offer --with-rundir configure argument

RUNDIR takes a default path of LOCALSTATEDIR/run, and is then used in
the SOCKPATH default path (RUNDIR/ctdb/ctdbd.socket). The eventual
SOCKPATH default value remains the same.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 Makefile.in  |  3 +++
 configure.ac | 15 +++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index a8e74a4..57ce1ed 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,6 +16,7 @@ sbindir = @sbindir@
 mandir = @mandir@
 localstatedir = @localstatedir@
 logdir = @LOGDIR@
+rundir = @RUNDIR@
 sockpath = @SOCKPATH@
 VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@:@teventdir@:
 srcdir = @srcdir@
@@ -67,6 +68,7 @@ CFLAGS=@CPPFLAGS@ -g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir)
 	-DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
 	-DCTDB_VARDIR=\"$(localstatedir)/lib/ctdb\" \
 	-DLOGDIR=\"$(logdir)\" -DBINDIR=\"$(bindir)\" \
+	-DRUNDIR=\"$(rundir)\" \
 	-DSOCKPATH=\"$(sockpath)\" \
 	-DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS) \
 	$(EXTRA_CFLAGS)
@@ -145,6 +147,7 @@ showlayout::
 	@echo "  libdir:      $(libdir)"
 	@echo "  vardir:      $(localstatedir)"
 	@echo "  logdir:      $(logdir)"
+	@echo "  rundir:      $(rundir)"
 	@echo "  mandir:      $(mandir)"
 	@echo "  etcdir:      $(etcdir)"
 
diff --git a/configure.ac b/configure.ac
index 9621f42..557c92b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,9 +72,20 @@ if test ! -z "$LOGDIR"; then
 fi
 AC_SUBST(LOGDIR)
 
-SOCKPATH='${localstatedir}/run/ctdb/ctdbd.socket'
+RUNDIR='${localstatedir}/run'
+AC_ARG_WITH([rundir],
+	[  --with-rundir=DIR       path to runtime directory [[LOCALSTATEDIR/run]]],
+	RUNDIR=$withval)
+if test ! -z "$RUNDIR"; then
+  if test "$RUNDIR" = "yes" -o "$RUNDIR" = "no"; then
+    AC_MSG_ERROR([--with-rundir must specify a path])
+  fi
+fi
+AC_SUBST(RUNDIR)
+
+SOCKPATH='${rundir}/ctdb/ctdbd.socket'
 AC_ARG_WITH([socketpath],
-	[  --with-socketpath=FILE       path to CTDB daemon socket [[LOCALSTATEDIR/run/ctdb/ctdbd.socket]]],
+	[  --with-socketpath=FILE       path to CTDB daemon socket [[RUNDIR/ctdb/ctdbd.socket]]],
 	SOCKPATH=$withval)
 if test ! -z "$SOCKPATH"; then
   if test "$SOCKPATH" = "yes" -o "$SOCKPATH" = "no"; then
-- 
1.8.4.5

openSUSE Build Service is sponsored by