pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/bind9 Fix the detection of bind on systems where i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3df8b1a2b421
branches:  trunk
changeset: 496326:3df8b1a2b421
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Jun 26 04:05:41 2005 +0000

description:
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:

 net/bind9/builtin.mk |  26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r df33150f7996 -r 3df8b1a2b421 net/bind9/builtin.mk
--- a/net/bind9/builtin.mk      Sat Jun 25 22:05:53 2005 +0000
+++ b/net/bind9/builtin.mk      Sun Jun 26 04:05:41 2005 +0000
@@ -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 @@
 ###
 .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 @@
 .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
 



Home | Main Index | Thread Index | Old Index