From 82f459ca807028e90ff5b8d0080e471bf1931905 Mon Sep 17 00:00:00 2001 From: Joerg Steffens Date: Fri, 7 Nov 2014 12:23:32 +0100 Subject: [PATCH] store Debian config templates in directory configured by --with-configtemplatedir Signed-off-by: Marco van Wieringen --- autoconf/configure.in | 27 +++++++++++++++++++ debian/bareos-bat.install.in | 1 + ...os-bat.postinst => bareos-bat.postinst.in} | 2 +- debian/bareos-bconsole.install.in | 1 + ...e.postinst => bareos-bconsole.postinst.in} | 2 +- debian/bareos-common.install.in | 6 ----- ...mon.postinst => bareos-common.postinst.in} | 1 - debian/bareos-director.install.in | 1 + ...r.postinst => bareos-director.postinst.in} | 10 +++---- debian/bareos-filedaemon.install.in | 1 + ...postinst => bareos-filedaemon.postinst.in} | 2 +- ...stinst => bareos-storage-fifo.postinst.in} | 0 ...stinst => bareos-storage-tape.postinst.in} | 0 debian/bareos-storage.install.in | 1 + ...ge.postinst => bareos-storage.postinst.in} | 2 +- debian/bareos-traymonitor.install.in | 1 + ...ostinst => bareos-traymonitor.postinst.in} | 2 +- debian/rules | 2 +- ...t => univention-bareos-schema.postinst.in} | 0 ...postinst => univention-bareos.postinst.in} | 0 20 files changed, 42 insertions(+), 20 deletions(-) rename debian/{bareos-bat.postinst => bareos-bat.postinst.in} (96%) rename debian/{bareos-bconsole.postinst => bareos-bconsole.postinst.in} (96%) rename debian/{bareos-common.postinst => bareos-common.postinst.in} (94%) rename debian/{bareos-director.postinst => bareos-director.postinst.in} (87%) rename debian/{bareos-filedaemon.postinst => bareos-filedaemon.postinst.in} (96%) rename debian/{bareos-storage-fifo.postinst => bareos-storage-fifo.postinst.in} (100%) rename debian/{bareos-storage-tape.postinst => bareos-storage-tape.postinst.in} (100%) rename debian/{bareos-storage.postinst => bareos-storage.postinst.in} (97%) rename debian/{bareos-traymonitor.postinst => bareos-traymonitor.postinst.in} (96%) rename debian/{univention-bareos-schema.postinst => univention-bareos-schema.postinst.in} (100%) rename debian/{univention-bareos.postinst => univention-bareos.postinst.in} (100%) diff --git a/autoconf/configure.in b/autoconf/configure.in index 17a7f7d6736..8a9ffdf545e 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -1459,6 +1459,22 @@ AC_ARG_WITH(plugindir, AC_SUBST(plugindir) +# ------------------------------------------ +# Where to place configtemplatedir (configuration template files) +# ------------------------------------------ +configtemplatedir=`eval echo ${libdir}` +AC_ARG_WITH(configtemplatedir, + AC_HELP_STRING([--with-configtemplatedir=PATH], [specify path of Bareos configuration templates directory (Debian only)]), + [ + if test "x$withval" != "xno" ; then + configtemplatedir=$withval + fi + ] +) + +AC_SUBST(configtemplatedir) + + dnl ------------------------------------------ dnl Where to send dump email dnl ------------------------------------------ @@ -3916,8 +3932,11 @@ debian|ubuntu|univention) DEBIAN_CONTROL_UNIVENTION_BAREOS_SCHEMA=/dev/null PFILES="${PFILES} ${DEBIAN_CONTROL} \ debian/bareos-bat.install \ + debian/bareos-bat.postinst \ debian/bareos-bconsole.install \ + debian/bareos-bconsole.postinst \ debian/bareos-common.install \ + debian/bareos-common.postinst \ debian/bareos-common.preinst \ debian/bareos-database-common.config \ debian/bareos-database-common.install \ @@ -3930,19 +3949,25 @@ debian|ubuntu|univention) debian/bareos-director-python-plugin.install \ debian/bareos-director.bareos-dir.init \ debian/bareos-director.install \ + debian/bareos-director.postinst \ debian/bareos-director.preinst \ debian/bareos-filedaemon-python-plugin.install \ debian/bareos-filedaemon.bareos-fd.init \ debian/bareos-filedaemon.install \ + debian/bareos-filedaemon.postinst \ debian/bareos-filedaemon.preinst \ + debian/bareos-storage-fifo.postinst \ debian/bareos-storage-fifo.install \ debian/bareos-storage-python-plugin.install \ + debian/bareos-storage-tape.postinst \ debian/bareos-storage-tape.install \ debian/bareos-storage.bareos-sd.init \ debian/bareos-storage.install \ + debian/bareos-storage.postinst \ debian/bareos-storage.preinst \ debian/bareos-tools.install \ debian/bareos-traymonitor.install \ + debian/bareos-traymonitor.postinst \ platforms/debian/Makefile \ platforms/debian/set_dbconfig_vars.sh" case "$DISTNAME" in @@ -3955,7 +3980,9 @@ debian|ubuntu|univention) DEBIAN_CONTROL_UNIVENTION_BAREOS_SCHEMA=./debian/control.univention-bareos-schema PFILES="${PFILES} \ debian/univention-bareos-schema.install \ + debian/univention-bareos-schema.postinst \ debian/univention-bareos.install \ + debian/univention-bareos.postinst \ platforms/univention/Makefile" ;; esac diff --git a/debian/bareos-bat.install.in b/debian/bareos-bat.install.in index d4821796209..134eaa45bff 100644 --- a/debian/bareos-bat.install.in +++ b/debian/bareos-bat.install.in @@ -1,3 +1,4 @@ +@sysconfdir@/bat.conf @configtemplatedir@ /usr/bin/bat /usr/share/pixmaps/bat.png /usr/share/pixmaps/bat.svg diff --git a/debian/bareos-bat.postinst b/debian/bareos-bat.postinst.in similarity index 96% rename from debian/bareos-bat.postinst rename to debian/bareos-bat.postinst.in index 232ba775016..7951e63537c 100644 --- a/debian/bareos-bat.postinst +++ b/debian/bareos-bat.postinst.in @@ -20,7 +20,7 @@ set -e daemon_user=bareos daemon_group=bareos -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="bat.conf" TARGET="/etc/bareos/${CONFIG}" diff --git a/debian/bareos-bconsole.install.in b/debian/bareos-bconsole.install.in index b4fa471f280..77e83995cae 100644 --- a/debian/bareos-bconsole.install.in +++ b/debian/bareos-bconsole.install.in @@ -1,4 +1,5 @@ @scriptdir@/bconsole +@sysconfdir@/bconsole.conf @configtemplatedir@ /usr/bin/bconsole /usr/sbin/bconsole /usr/share/man/man1/bconsole.1.gz diff --git a/debian/bareos-bconsole.postinst b/debian/bareos-bconsole.postinst.in similarity index 96% rename from debian/bareos-bconsole.postinst rename to debian/bareos-bconsole.postinst.in index d6f03804041..9b21c35c0c7 100644 --- a/debian/bareos-bconsole.postinst +++ b/debian/bareos-bconsole.postinst.in @@ -20,7 +20,7 @@ set -e daemon_user=bareos daemon_group=bareos -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="bconsole.conf" TARGET="/etc/bareos/${CONFIG}" diff --git a/debian/bareos-common.install.in b/debian/bareos-common.install.in index 84b854d7981..1c925002255 100644 --- a/debian/bareos-common.install.in +++ b/debian/bareos-common.install.in @@ -14,9 +14,3 @@ /usr/share/man/man1/bsmtp.1.gz /usr/share/man/man8/btraceback.8.gz /var/lib/bareos/ -/etc/bareos/bat.conf usr/share/bareos-common/defconfig -/etc/bareos/bconsole.conf usr/share/bareos-common/defconfig -/etc/bareos/bareos-dir.conf usr/share/bareos-common/defconfig -/etc/bareos/bareos-fd.conf usr/share/bareos-common/defconfig -/etc/bareos/bareos-sd.conf usr/share/bareos-common/defconfig -/etc/bareos/tray-monitor.conf usr/share/bareos-common/defconfig diff --git a/debian/bareos-common.postinst b/debian/bareos-common.postinst.in similarity index 94% rename from debian/bareos-common.postinst rename to debian/bareos-common.postinst.in index a8864c34861..2aa60ac2704 100644 --- a/debian/bareos-common.postinst +++ b/debian/bareos-common.postinst.in @@ -22,7 +22,6 @@ daemon_group=bareos permissions() { - chown ${daemon_user}:${daemon_group} /etc/bareos/bareos-dir.d chown ${daemon_user}:${daemon_group} /var/lib/bareos/ chown ${daemon_user}:${daemon_group} /var/log/bareos/ } diff --git a/debian/bareos-director.install.in b/debian/bareos-director.install.in index ec67e76f8a9..7702f18622d 100644 --- a/debian/bareos-director.install.in +++ b/debian/bareos-director.install.in @@ -3,6 +3,7 @@ @scriptdir@/make_catalog_backup @scriptdir@/make_catalog_backup.pl @scriptdir@/query.sql +@sysconfdir@/bareos-dir.conf @configtemplatedir@ /usr/sbin/bareos-dir /usr/share/man/man8/bareos-dir.8.gz /usr/share/man/man8/bareos.8.gz diff --git a/debian/bareos-director.postinst b/debian/bareos-director.postinst.in similarity index 87% rename from debian/bareos-director.postinst rename to debian/bareos-director.postinst.in index 3fa2b4d7cfd..bb56d8b7018 100644 --- a/debian/bareos-director.postinst +++ b/debian/bareos-director.postinst.in @@ -20,19 +20,15 @@ set -e daemon_user=bareos daemon_group=bareos -director_daemon_user=$daemon_user -#storage_daemon_user=$daemon_user -#file_daemon_user=root -#storage_daemon_group=$daemon_group - -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="bareos-dir.conf" TARGET="/etc/bareos/${CONFIG}" permissions() { - chown ${director_daemon_user}:${daemon_group} $TARGET + chown ${daemon_user}:${daemon_group} /etc/bareos/bareos-dir.d + chown ${daemon_user}:${daemon_group} $TARGET chmod 640 $TARGET } diff --git a/debian/bareos-filedaemon.install.in b/debian/bareos-filedaemon.install.in index b5c0f2564d5..e206c66508f 100644 --- a/debian/bareos-filedaemon.install.in +++ b/debian/bareos-filedaemon.install.in @@ -1,2 +1,3 @@ +@sysconfdir@/bareos-fd.conf @configtemplatedir@ /usr/sbin/bareos-fd /usr/share/man/man8/bareos-fd.8.gz diff --git a/debian/bareos-filedaemon.postinst b/debian/bareos-filedaemon.postinst.in similarity index 96% rename from debian/bareos-filedaemon.postinst rename to debian/bareos-filedaemon.postinst.in index 5451b73f762..fd6c4cc69b0 100644 --- a/debian/bareos-filedaemon.postinst +++ b/debian/bareos-filedaemon.postinst.in @@ -25,7 +25,7 @@ daemon_group=bareos file_daemon_user=root #storage_daemon_group=$daemon_group -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="bareos-fd.conf" TARGET="/etc/bareos/${CONFIG}" diff --git a/debian/bareos-storage-fifo.postinst b/debian/bareos-storage-fifo.postinst.in similarity index 100% rename from debian/bareos-storage-fifo.postinst rename to debian/bareos-storage-fifo.postinst.in diff --git a/debian/bareos-storage-tape.postinst b/debian/bareos-storage-tape.postinst.in similarity index 100% rename from debian/bareos-storage-tape.postinst rename to debian/bareos-storage-tape.postinst.in diff --git a/debian/bareos-storage.install.in b/debian/bareos-storage.install.in index 48a7996109c..6bbe5801ed4 100644 --- a/debian/bareos-storage.install.in +++ b/debian/bareos-storage.install.in @@ -1,6 +1,7 @@ /usr/sbin/bscrypto @plugindir@/scsicrypto-sd.so @scriptdir@/disk-changer +@sysconfdir@/bareos-sd.conf @configtemplatedir@ /usr/sbin/bareos-sd /usr/share/man/man8/bscrypto.8.gz /usr/share/man/man8/bareos-sd.8.gz diff --git a/debian/bareos-storage.postinst b/debian/bareos-storage.postinst.in similarity index 97% rename from debian/bareos-storage.postinst rename to debian/bareos-storage.postinst.in index 9f02c4ead00..559d914847b 100644 --- a/debian/bareos-storage.postinst +++ b/debian/bareos-storage.postinst.in @@ -25,7 +25,7 @@ storage_daemon_user=$daemon_user #file_daemon_user=root storage_daemon_group=$daemon_group -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="bareos-sd.conf" TARGET="/etc/bareos/${CONFIG}" diff --git a/debian/bareos-traymonitor.install.in b/debian/bareos-traymonitor.install.in index 010d3278c63..a97d64c1c8f 100644 --- a/debian/bareos-traymonitor.install.in +++ b/debian/bareos-traymonitor.install.in @@ -1,4 +1,5 @@ /etc/xdg/autostart/bareos-tray-monitor.desktop +@sysconfdir@/tray-monitor.conf @configtemplatedir@ /usr/bin/bareos-tray-monitor /usr/share/man/man1/bareos-tray-monitor.1.gz /usr/share/applications/bareos-tray-monitor.desktop diff --git a/debian/bareos-traymonitor.postinst b/debian/bareos-traymonitor.postinst.in similarity index 96% rename from debian/bareos-traymonitor.postinst rename to debian/bareos-traymonitor.postinst.in index d69f0f89ed7..6c65df2de8f 100644 --- a/debian/bareos-traymonitor.postinst +++ b/debian/bareos-traymonitor.postinst.in @@ -20,7 +20,7 @@ set -e daemon_user=bareos daemon_group=bareos -DEFCONFIGDIR="/usr/share/bareos-common/defconfig" +DEFCONFIGDIR="@configtemplatedir@" CONFIG="tray-monitor.conf" TARGET="/etc/bareos/${CONFIG}" diff --git a/debian/rules b/debian/rules index 5e977a8290e..9ad1a37e070 100755 --- a/debian/rules +++ b/debian/rules @@ -23,7 +23,6 @@ DIRECTOR_DAEMON_USER = $(DAEMON_USER) STORAGE_DAEMON_USER = $(DAEMON_USER) FILE_DAEMON_USER = root STORAGE_DAEMON_GROUP = $(DAEMON_GROUP) -WORKING_DIR = /var/lib/bareos define CONFIGURE_COMMON --with-sbin-perm=755 \ @@ -31,6 +30,7 @@ define CONFIGURE_COMMON --sysconfdir=/etc/bareos \ --with-archivedir=/var/lib/bareos/storage \ --with-backenddir=/usr/lib/bareos/backends \ + --with-configtemplatedir=/usr/lib/bareos/defaultconfigs \ --with-scriptdir=/usr/lib/bareos/scripts \ --with-plugindir=/usr/lib/bareos/plugins \ --with-working-dir=/var/lib/bareos \ diff --git a/debian/univention-bareos-schema.postinst b/debian/univention-bareos-schema.postinst.in similarity index 100% rename from debian/univention-bareos-schema.postinst rename to debian/univention-bareos-schema.postinst.in diff --git a/debian/univention-bareos.postinst b/debian/univention-bareos.postinst.in similarity index 100% rename from debian/univention-bareos.postinst rename to debian/univention-bareos.postinst.in