Jörg Steffens <joerg.steff...@bareos.com> writes:

> Am 07.09.2016 um 20:17 schrieb Kjetil Torgrim Homme:
>> I like the new scheme, although I will not use it myself since I manage
>> clients and jobs via Puppet.  however, it is annoying that when I do
>> "make install" from the git master, I get a lot of gunk in /etc/bareos.
>> 
>> it would be nice if configure had a switch to disable the installation
>> of default configuration, or even better, if it installed it to
>> "$docdir/example-config/" and left it completely up to packagers what to
>> put in "/etc/bareos".
>> 
>> FWIW, I currently use these path related settings with configure:
>> 
>> ./configure --prefix=/opt/bareos --with-confdir=/etc/bareos 
>> --with-scriptdir=/etc/bareos/distscripts
>> 
>> (the latter setting helps a lot, and I certainly don't want my finely
>> tuned query.sql to be garbled after each make install ;)
>
> So, configure already offers the functionality you suggested. Or am I
> missing something? (Patches welcome)

yes and no, I still get the bareos-XX.d directories.  but thanks for the
prod, I looked a little closer and found that debian.rules uses:

  --with-configtemplatedir=/usr/lib/bareos/defaultconfigs

so that would solve my problem, except it is only used in the files in
debian/.  the default is a bit strange, too:

  autoconf/configure.in:configtemplatedir=`eval echo ${libdir}`

so this should change to confdir (Debian overrides the default anyhow),
and configtemplatedir should be added to autoconf/Make.common.in

patch:

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To post to this group, send email to bareos-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
From: Kjetil Torgrim Homme <kjetil.ho...@redpill-linpro.com>
Date: Thu, 8 Sep 2016 14:54:21 +0200
Subject: [PATCH] allow use of configtemplatedir to install example
 configuration outside confdir


diff --git a/autoconf/Make.common.in b/autoconf/Make.common.in
index f9a0deb..ae69f62 100644
--- a/autoconf/Make.common.in
+++ b/autoconf/Make.common.in
@@ -32,6 +32,7 @@ logdir = @logdir@
 includedir = @includedir@
 sysconfdir = @sysconfdir@
 confdir = @confdir@
+configtemplatedir = @configtemplatedir@
 backenddir = @backenddir@
 plugindir = @plugindir@
 scriptdir = @scriptdir@
diff --git a/autoconf/configure.in b/autoconf/configure.in
index b4f8b0f..091ceff 100644
--- a/autoconf/configure.in
+++ b/autoconf/configure.in
@@ -1549,9 +1549,9 @@ AC_SUBST(plugindir)
 # ------------------------------------------
 # Where to place configtemplatedir (configuration template files)
 # ------------------------------------------
-configtemplatedir=`eval echo ${libdir}`
+configtemplatedir=`eval echo ${confdir}`
 AC_ARG_WITH(configtemplatedir,
-   AC_HELP_STRING([--with-configtemplatedir=PATH], [specify path of Bareos configuration templates directory (Debian only)]),
+   AC_HELP_STRING([--with-configtemplatedir=PATH], [specify path of Bareos configuration templates directory]),
    [
        if test "x$withval" != "xno" ; then
 	  configtemplatedir=$withval
diff --git a/src/dird/Makefile.in b/src/dird/Makefile.in
index 5696818..a17951c 100644
--- a/src/dird/Makefile.in
+++ b/src/dird/Makefile.in
@@ -147,7 +147,7 @@ install: all
 	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bareos-dbcheck $(DESTDIR)$(sbindir)/bareos-dbcheck
 	# copy configuration resource files to directory structure
 	@SRCCONFDIR=../defaultconfigs/bareos-dir.d/; \
-	DESTCONFDIR=${DESTDIR}${confdir}/bareos-dir.d/; \
+	DESTCONFDIR=${DESTDIR}${configtemplatedir}/bareos-dir.d/; \
 	echo "installing configuration resource files to $$DESTCONFDIR"; \
 	$(MKDIR) $$DESTCONFDIR; \
 	for RESTYPE in $(DIRD_RESTYPES); do \
diff --git a/src/filed/Makefile.in b/src/filed/Makefile.in
index 95ecbb2..709ac52 100644
--- a/src/filed/Makefile.in
+++ b/src/filed/Makefile.in
@@ -124,7 +124,7 @@ devclean: realclean
 install: all
 	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bareos-fd $(DESTDIR)$(sbindir)/bareos-fd
 	@SRCCONFDIR=../defaultconfigs/bareos-fd.d/; \
-	DESTCONFDIR=${DESTDIR}${confdir}/bareos-fd.d/; \
+	DESTCONFDIR=${DESTDIR}${configtemplatedir}/bareos-fd.d/; \
 	echo "installing configuration resource files to $$DESTCONFDIR"; \
 	$(MKDIR) $$DESTCONFDIR; \
 	for RESTYPE in $(FILED_RESTYPES); do \
diff --git a/src/stored/Makefile.in b/src/stored/Makefile.in
index e4d431b..5161610 100644
--- a/src/stored/Makefile.in
+++ b/src/stored/Makefile.in
@@ -246,7 +246,7 @@ install: all @LIBTOOL_INSTALL_TARGET@
 	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) btape $(DESTDIR)$(sbindir)/btape
 	# copy configuration resource files to directory structure
 	@SRCCONFDIR=../defaultconfigs/bareos-sd.d/; \
-	DESTCONFDIR=${DESTDIR}${confdir}/bareos-sd.d/; \
+	DESTCONFDIR=${DESTDIR}${configtemplatedir}/bareos-sd.d/; \
 	echo "installing configuration resource files to $$DESTCONFDIR"; \
 	$(MKDIR) $$DESTCONFDIR; \
 	for RESTYPE in $(STORED_RESTYPES); do \
-- 
Kjetil T. Homme
Redpill Linpro AS - Changing the game

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To post to this group, send email to bareos-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to