pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/libpcap Better checking of libpcap versions, based...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/64afc3dd6603
branches:  trunk
changeset: 487243:64afc3dd6603
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Tue Jan 11 19:32:17 2005 +0000

description:
Better checking of libpcap versions, based in heimdal/builtin.mk.
for now we are assumming that:

_LIBPCAP_VERSIONS=      0.8.3  0.7.2
_LIBPCAP_0.8.3=         NetBSD-2.99.9* NetBSD-2.99.1[0-9]*
_LIBPCAP_0.7=           NetBSD-1.[56]* NetBSD-2.0*

Users of other platforms should update this list eventually.

diffstat:

 net/libpcap/builtin.mk |  66 ++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 61 insertions(+), 5 deletions(-)

diffs (75 lines):

diff -r 89b298aa1592 -r 64afc3dd6603 net/libpcap/builtin.mk
--- a/net/libpcap/builtin.mk    Tue Jan 11 18:44:10 2005 +0000
+++ b/net/libpcap/builtin.mk    Tue Jan 11 19:32:17 2005 +0000
@@ -1,10 +1,66 @@
-# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:32 jlam Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/01/11 19:32:17 xtraeme Exp $
+
+_LIBPCAP_H=    /usr/include/pcap.h
 
 .if !defined(IS_BUILTIN.libpcap)
 IS_BUILTIN.libpcap=    no
-.  if exists(/usr/include/pcap.h)
-IS_BUILTIN.libpcap=    yes
+.  if exists(${_LIBPCAP_H})
+IS_BUILTIN.libpcap!=                                                   \
+       if ${GREP} -q PCAP_VERSION_MAJOR ${_LIBPCAP_H}; then            \
+               ${ECHO} "yes";                                          \
+       else                                                            \
+               ${ECHO} "no";                                           \
+       fi
+.    if !empty(IS_BUILTIN.libpcap:M[yY][eE][sS])
+#
+# Create an appropriate name for the built-in package distributed
+# with the system.  This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
+# version or if the built-in one is sufficient.
+#
+.      if !defined(_LIPCAP_VERSION)
+_LIBPCAP_VERSIONS=     0.8.3  0.7.2
+_LIBPCAP_0.8.3=                NetBSD-2.99.9* NetBSD-2.99.1[0-9]*
+_LIBPCAP_0.7=          NetBSD-1.[56]* NetBSD-2.0*
+.        for _libpcap_version_ in ${_LIBPCAP_VERSIONS}
+.          for _pattern_ in ${_LIBPCAP_${_libpcap_version_}}
+.            if !empty(MACHINE_PLATFORM:M${_pattern_})
+_LIBPCAP_VERSION?=     ${_libpcap_version_}
+.            endif
+.          endfor
+.        endfor
+_LIBPCAP_VERSION?=     0.7.2
+.      endif
+BUILTIN_PKG.libpcap=   libpcap-${_LIBPCAP_VERSION}
+MAKEFLAGS+=            BUILTIN_PKG.libpcap=${BUILTIN_PKG.libpcap}
+.    endif
 .  endif
-.endif # IS_BUILTIN.libpcap
+MAKEFLAGS+=    IS_BUILTIN.libpcap=${IS_BUILTIN.libpcap}
+.endif
+
+.if !defined(USE_BUILTIN.libpcap)
+USE_BUILTIN.libpcap?=  ${IS_BUILTIN.libpcap}
 
-USE_BUILTIN.libpcap?=  ${IS_BUILTIN.libpcap}
+.  if defined(BUILTIN_PKG.libpcap)
+USE_BUILTIN.libpcap=   yes
+.    for _depend_ in ${BUILDLINK_DEPENDS.libpcap}
+.      if !empty(USE_BUILTIN.libpcap:M[yY][eE][sS])
+USE_BUILTIN.libpcap!=  \
+       if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.libpcap}; then \
+               ${ECHO} "yes";                                          \
+       else                                                            \
+               ${ECHO} "no";                                           \
+       fi
+.      endif
+.    endfor
+.  endif
+.endif # USE_BUILTIN.libpcap
+
+CHECK_BUILTIN.libpcap?=        no
+.if !empty(CHECK_BUILTIN.libpcap:M[nN][oO])
+
+.if !empty(USE_BUILTIN.libpcap:M[nN][oO])
+BUILDLINK_DEPENDS.libpcap+=    libpcap>=0.8.3
+.endif
+
+.endif # CHECK_BUILTIN.libpcap



Home | Main Index | Thread Index | Old Index