From 724a4f3ae0d7170e20d73c7c388daaed801ea40e Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 5 Jan 2015 13:20:04 +0000 Subject: [PATCH] - patch from Brad Smith that fixes DESTDIR in unbound-control-setup for installs where config is not in the prefix location. git-svn-id: file:///svn/unbound/trunk@3297 be551aaa-1e26-0410-a405-d3ace91eadb9 --- configure | 25 +++++++++++++++++++++++++ configure.ac | 2 ++ doc/Changelog | 2 ++ smallapp/unbound-control-setup.sh.in | 3 +-- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 1d230bdd2..acfc7bc6b 100755 --- a/configure +++ b/configure @@ -733,6 +733,7 @@ UNBOUND_PIDFILE UNBOUND_SHARE_DIR UNBOUND_CHROOT_DIR UNBOUND_RUN_DIR +ub_conf_dir ub_conf_file EGREP GREP @@ -4048,6 +4049,30 @@ cat >>confdefs.h <<_ACEOF #define CONFIGFILE "$hdr_config" _ACEOF +ub_conf_dir=`$as_dirname -- "$ub_conf_file" || +$as_expr X"$ub_conf_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ub_conf_file" : 'X\(//\)[^/]' \| \ + X"$ub_conf_file" : 'X\(//\)$' \| \ + X"$ub_conf_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ub_conf_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + # Determine run, chroot directory and pidfile locations diff --git a/configure.ac b/configure.ac index df5922793..d5818818c 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,8 @@ AC_ARG_WITH([conf_file], AC_SUBST(ub_conf_file) ACX_ESCAPE_BACKSLASH($ub_conf_file, hdr_config) AC_DEFINE_UNQUOTED(CONFIGFILE, ["$hdr_config"], [Pathname to the Unbound configuration file]) +ub_conf_dir=`AS_DIRNAME(["$ub_conf_file"])` +AC_SUBST(ub_conf_dir) # Determine run, chroot directory and pidfile locations AC_ARG_WITH(run-dir, diff --git a/doc/Changelog b/doc/Changelog index aa6e23228..62d87eedb 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,8 @@ - patch from Stephane Lapie that adds to the python API, that exposes struct delegpt, and adds the find_delegation function. - print query name when max target count is exceeded. + - patch from Brad Smith that fixes DESTDIR in unbound-control-setup + for installs where config is not in the prefix location. 9 December 2014: Wouter - svn trunk has 1.5.2 in development. diff --git a/smallapp/unbound-control-setup.sh.in b/smallapp/unbound-control-setup.sh.in index 79605dc6f..75e76e25d 100644 --- a/smallapp/unbound-control-setup.sh.in +++ b/smallapp/unbound-control-setup.sh.in @@ -36,8 +36,7 @@ # settings: # directory for files -prefix=@prefix@ -DESTDIR=@sysconfdir@/unbound +DESTDIR=@ub_conf_dir@ # issuer and subject name for certificates SERVERNAME=unbound -- 2.47.2