diff options
author | jlam <jlam@pkgsrc.org> | 2005-06-26 04:05:41 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2005-06-26 04:05:41 +0000 |
commit | ce3a0baf986a093ee3045abd1a246d87df6a2003 (patch) | |
tree | 5ad903e84392145c76b8d188940fbe07121a36d1 /net/bind9 | |
parent | 81cf30e3b1e5ced805cdd43ae1d4ae10c222f62f (diff) | |
download | pkgsrc-ce3a0baf986a093ee3045abd1a246d87df6a2003.tar.gz |
Fix the detection of bind on systems where it's available natively.
This bug was introduced in revision 1.7 where bind was determined to
be built-in only if libbind.* existed on the system, which isn't
necessarily true on systems where the resolver routines are incorporated
into libc, e.g. NetBSD.
We now consider bind to be built-in if BUILTIN_VERSION.bind is defined,
and we define BUILTIN_VERSION.bind only if /usr/sbin/named exists on
the system. We also improve the derivation of the version number of
BIND by parsing the named output, so we can now also detect bind-4.x
and bind-8.x.
Diffstat (limited to 'net/bind9')
-rw-r--r-- | net/bind9/builtin.mk | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/bind9/builtin.mk b/net/bind9/builtin.mk index 0e2987ef934..b0108fe5482 100644 --- a/net/bind9/builtin.mk +++ b/net/bind9/builtin.mk @@ -1,16 +1,25 @@ -# $NetBSD: builtin.mk,v 1.8 2005/06/02 00:27:22 jlam Exp $ +# $NetBSD: builtin.mk,v 1.9 2005/06/26 04:05:41 jlam Exp $ BUILTIN_PKG:= bind -BUILTIN_FIND_LIBS:= bind +BUILTIN_FIND_FILES_VAR:= EXE_NAMED +BUILTIN_FIND_FILES.EXE_NAMED= /usr/sbin/named +BUILTIN_FIND_LIBS:= bind .include "../../mk/buildlink3/bsd.builtin.mk" -.if !defined(BUILTIN_VERSION.bind) -. if exists(/usr/sbin/named) +### +### Figure out the version of BIND if an ISC BIND named exists on the +### system. +### +.if !defined(BUILTIN_VERSION.bind) && \ + empty(EXE_NAMED:M${LOCALBASE}/*) && exists(${EXE_NAMED}) BUILTIN_VERSION.bind!= \ - ${ECHO} 'vers ' && /usr/sbin/named -v | ${SED} -n 's/^BIND //p' -. endif + ${EXE_NAMED} -v 2>/dev/null | ${HEAD} -1 | \ + ${AWK} 'BEGIN { v = "4.9.11"; } \ + /^BIND / { v = $$2; sub("-.*", "", v); } \ + /^named / { v = $$2; sub("-.*", "", v); } \ + END { print v; }' .endif MAKEVARS+= BUILTIN_VERSION.bind @@ -20,8 +29,7 @@ MAKEVARS+= BUILTIN_VERSION.bind ### .if !defined(IS_BUILTIN.bind) IS_BUILTIN.bind= no -. if !empty(BUILTIN_VERSION.bind:Nvers) && \ - !empty(BUILTIN_LIB_FOUND.bind:M[yY][eE][sS]) +. if defined(BUILTIN_VERSION.bind) IS_BUILTIN.bind= yes . endif .endif @@ -34,7 +42,7 @@ MAKEVARS+= IS_BUILTIN.bind .if !defined(BUILTIN_PKG.bind) && \ !empty(IS_BUILTIN.bind:M[yY][eE][sS]) && \ defined(BUILTIN_VERSION.bind) -BUILTIN_PKG.bind= bind-${BUILTIN_VERSION.bind:Nvers} +BUILTIN_PKG.bind= bind-${BUILTIN_VERSION.bind} .endif MAKEVARS+= BUILTIN_PKG.bind |