From 0b10c8da28f9b8c7a089eb3d0cc59659c0791b7f Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 17 May 2017 15:04:05 +0000 Subject: [PATCH] Fixup with prefix and exec_prefix expanded. git-svn-id: file:///svn/unbound/trunk@4172 be551aaa-1e26-0410-a405-d3ace91eadb9 --- configure | 17 +++++++++++++++++ configure.ac | 13 +++++++++++++ contrib/unbound.service.in | 6 +++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 34e755126..8403d6bed 100755 --- a/configure +++ b/configure @@ -757,6 +757,10 @@ UNBOUND_CHROOT_DIR UNBOUND_RUN_DIR ub_conf_dir ub_conf_file +UNBOUND_LOCALSTATE_DIR +UNBOUND_SYSCONF_DIR +UNBOUND_SBIN_DIR +UNBOUND_BIN_DIR EGREP GREP CPP @@ -4111,6 +4115,11 @@ case "$prefix" in prefix="/usr/local" ;; esac +case "$exec_prefix" in + NONE) + exec_prefix="/usr/local" + ;; +esac # are we on MinGW? if uname -s 2>&1 | grep MINGW32 >/dev/null; then on_mingw="yes" @@ -4122,6 +4131,14 @@ fi # # Determine configuration file # the eval is to evaluate shell expansion twice +UNBOUND_BIN_DIR=`eval echo "${bindir}"` + +UNBOUND_SBIN_DIR=`eval echo "${sbindir}"` + +UNBOUND_SYSCONF_DIR=`eval echo "${sysconfdir}"` + +UNBOUND_LOCALSTATE_DIR=`eval echo "${localstatedir}"` + if test $on_mingw = "no"; then ub_conf_file=`eval echo "${sysconfdir}/unbound/unbound.conf"` else diff --git a/configure.ac b/configure.ac index b76f745f8..4409a26a4 100644 --- a/configure.ac +++ b/configure.ac @@ -109,6 +109,11 @@ case "$prefix" in prefix="/usr/local" ;; esac +case "$exec_prefix" in + NONE) + exec_prefix="/usr/local" + ;; +esac # are we on MinGW? if uname -s 2>&1 | grep MINGW32 >/dev/null; then on_mingw="yes" @@ -120,6 +125,14 @@ fi # # Determine configuration file # the eval is to evaluate shell expansion twice +UNBOUND_BIN_DIR=`eval echo "${bindir}"` +AC_SUBST(UNBOUND_BIN_DIR) +UNBOUND_SBIN_DIR=`eval echo "${sbindir}"` +AC_SUBST(UNBOUND_SBIN_DIR) +UNBOUND_SYSCONF_DIR=`eval echo "${sysconfdir}"` +AC_SUBST(UNBOUND_SYSCONF_DIR) +UNBOUND_LOCALSTATE_DIR=`eval echo "${localstatedir}"` +AC_SUBST(UNBOUND_LOCALSTATE_DIR) if test $on_mingw = "no"; then ub_conf_file=`eval echo "${sysconfdir}/unbound/unbound.conf"` else diff --git a/contrib/unbound.service.in b/contrib/unbound.service.in index 6008c1fce..3ada5758c 100644 --- a/contrib/unbound.service.in +++ b/contrib/unbound.service.in @@ -6,8 +6,8 @@ Documentation=man:unbound(8) WantedBy=multi-user.target [Service] -ExecReload=@bindir@/kill -HUP $MAINPID -ExecStart=@sbindir@/unbound +ExecReload=@UNBOUND_BIN_DIR@/kill -HUP $MAINPID +ExecStart=@UNBOUND_SBIN_DIR@/unbound NotifyAccess=main Type=notify CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT @@ -20,7 +20,7 @@ ProtectControlGroups=true ProtectKernelModules=true ProtectKernelTunables=true ProtectSystem=strict -ReadWritePaths=@sysconfdir@ @localstatedir@ /run +ReadWritePaths=@UNBOUND_SYSCONF_DIR@ @UNBOUND_LOCALSTATE_DIR@ /run @UNBOUND_RUN_DIR@ RestrictAddressFamilies=AF_INET AF_UNIX RestrictRealtime=true SystemCallArchitectures=native -- 2.47.3