summaryrefslogtreecommitdiff
path: root/net/bind9
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-06-26 04:05:41 +0000
committerjlam <jlam@pkgsrc.org>2005-06-26 04:05:41 +0000
commit87a3b87740342a146d389f29daede78921567000 (patch)
tree5ad903e84392145c76b8d188940fbe07121a36d1 /net/bind9
parent5f75fac6298793f0aa7890a4b89e38f742bb23e7 (diff)
downloadpkgsrc-87a3b87740342a146d389f29daede78921567000.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.mk26
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