Improve build system a little. openresolv-3.2
authorRoy Marples <roy@marples.name>
Thu, 26 Mar 2009 11:43:33 +0000 (11:43 +0000)
committerRoy Marples <roy@marples.name>
Thu, 26 Mar 2009 11:43:33 +0000 (11:43 +0000)
Makefile
libc.in
resolvconf.8.in
resolvconf.in

index 89e75810069a6587573fa1d72a07880f21e79a80..fde2f6e04f4b84ba54e2819e777ca582a46a5280 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ MANMODE?=     0444
 SYSCONFDIR?=   ${PREFIX}/etc
 BINDIR=                ${PREFIX}/sbin
 LIBEXECDIR?=   ${PREFIX}/libexec/resolvconf
 SYSCONFDIR?=   ${PREFIX}/etc
 BINDIR=                ${PREFIX}/sbin
 LIBEXECDIR?=   ${PREFIX}/libexec/resolvconf
+VARDIR?=       ${VARBASE}/run/resolvconf
 MANDIR?=       ${MANPREFIX}/man
 
 RESOLVCONF=    resolvconf resolvconf.8 resolvconf.conf.5
 MANDIR?=       ${MANPREFIX}/man
 
 RESOLVCONF=    resolvconf resolvconf.8 resolvconf.conf.5
@@ -28,7 +29,7 @@ all: ${TARGET}
        sed -e 's:@PREFIX@:${PREFIX}:g' \
                -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
                -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' \
        sed -e 's:@PREFIX@:${PREFIX}:g' \
                -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
                -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' \
-               -e 's:@VARBASE@:${VARBASE}:g' \
+               -e 's:@VARDIR@:${VARDIR}:g' \
                $@.in > $@
 
 clean:
                $@.in > $@
 
 clean:
diff --git a/libc.in b/libc.in
index db5d2a13243e74f8b8508429d7ef2d63cc782857..e11a70e26728bc8f7f1ed4954a27826a5b39a458 100644 (file)
--- a/libc.in
+++ b/libc.in
@@ -29,8 +29,8 @@
 RESOLVCONF="${RESOLVCONF:-resolvconf}"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 RESOLVCONF="${RESOLVCONF:-resolvconf}"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
-VARBASE=@VARBASE@
-IFACEDIR="${VARBASE}/run/resolvconf/interfaces"
+VARDIR=@VARDIR@
+IFACEDIR="${VARDIR}/interfaces"
 
 # sed may not be available, and this is faster on small files
 key_get_value()
 
 # sed may not be available, and this is faster on small files
 key_get_value()
@@ -86,10 +86,10 @@ uniqify()
                case " ${result} " in
                *" $1 "*);;
                *) result="${result} $1";;
                case " ${result} " in
                *" $1 "*);;
                *) result="${result} $1";;
-esac
-shift
-done
-echo "${result# *}"
+               esac
+               shift
+       done
+       echo "${result# *}"
 }
 
 case "${resolv_conf_passthrough:-NO}" in
 }
 
 case "${resolv_conf_passthrough:-NO}" in
index 8dba96e5d29a5fff38bb98fcd7c8ea6561d249b5..dcecc43e63e6bde93fe76e0fed209f6dece89ad3 100644 (file)
@@ -190,7 +190,7 @@ Directory of subscribers which are run every time
 adds, deletes or updates.
 .It Pa @LIBEXECDIR@/libc.d
 Directory of subscribers which are run after the libc subscriber is run.
 adds, deletes or updates.
 .It Pa @LIBEXECDIR@/libc.d
 Directory of subscribers which are run after the libc subscriber is run.
-.It Pa @VARBASE@/run/resolvconf
+.It Pa @VARDIR@
 State directory for
 .Nm .
 .El
 State directory for
 .Nm .
 .El
index 16bc29e4eb01703ff4302a4e240aca7156066025..7b28cb807ff4197b6c6caefbb2febf6379c730a9 100644 (file)
@@ -27,7 +27,7 @@
 ARGV0="$0"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 ARGV0="$0"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
-VARDIR=@VARBASE@/run/resolvconf
+VARDIR=@VARDIR@
 IFACEDIR="${VARDIR}/interfaces"
 METRICDIR="${VARDIR}/metrics"
 PRIVATEDIR="${VARDIR}/private"
 IFACEDIR="${VARDIR}/interfaces"
 METRICDIR="${VARDIR}/metrics"
 PRIVATEDIR="${VARDIR}/private"
@@ -344,7 +344,6 @@ if [ "${cmd}" = "a" ]; then
        [ "${cmd}" = "a" -a -t 0 ] && error_exit "No file given via stdin"
 fi
 
        [ "${cmd}" = "a" -a -t 0 ] && error_exit "No file given via stdin"
 fi
 
-# Ensure that libdir exists
 if [ ! -d "${IFACEDIR}" ]; then
        if [ ! -d "${VARDIR}" ]; then
                if [ -L "${VARDIR}" ]; then
 if [ ! -d "${IFACEDIR}" ]; then
        if [ ! -d "${VARDIR}" ]; then
                if [ -L "${VARDIR}" ]; then