pkgsrc-Changes-HG archive

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

[pkgsrc/pkgsrc-2005Q2]: pkgsrc/net/bind9 Pullup ticket 568 - requested by Joh...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/79f1b9431107
branches:  pkgsrc-2005Q2
changeset: 495835:79f1b9431107
user:      salo <salo%pkgsrc.org@localhost>
date:      Mon Jun 27 00:49:23 2005 +0000

description:
Pullup ticket 568 - requested by Johnny C. Lam
built-in detection fix for bind9

Revisions pulled up:
- pkgsrc/net/bind9/builtin.mk   1.9

   Module Name:         pkgsrc
   Committed By:        jlam
   Date:                Sun Jun 26 04:05:41 UTC 2005

   Modified Files:
        pkgsrc/net/bind9: builtin.mk

   Log Message:
   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 3e943481273c -r 79f1b9431107 net/bind9/builtin.mk
--- a/net/bind9/builtin.mk      Sat Jun 25 21:42:13 2005 +0000
+++ b/net/bind9/builtin.mk      Mon Jun 27 00:49:23 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.8.2.1 2005/06/27 00:49:23 salo 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