pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/zlib Fix brokenness introduced as part of the up...
details: https://anonhg.NetBSD.org/pkgsrc/rev/eddee2387110
branches: trunk
changeset: 466505:eddee2387110
user: jlam <jlam%pkgsrc.org@localhost>
date: Mon Jan 19 23:11:19 2004 +0000
description:
Fix brokenness introduced as part of the update of zlib to 1.2.1. The
updated package update bumped the zlib shared lib major, which required
that BUILDLINK_DEPENDS.zlib be bumped as well. Rather then requiring
zlib>=1.2.1 for packages that can use the built-in zlib on *BSD systems,
allow those built-in versions to satisfy zlib>=1.1.4nb1 dependencies,
and only require the latest version if no suitable zlib is found.
diffstat:
devel/zlib/buildlink2.mk | 103 +++++++++++++++++++++++++++++++---------------
devel/zlib/buildlink3.mk | 63 ++++++++++++++++++++-------
2 files changed, 114 insertions(+), 52 deletions(-)
diffs (218 lines):
diff -r 3429ea56deee -r eddee2387110 devel/zlib/buildlink2.mk
--- a/devel/zlib/buildlink2.mk Mon Jan 19 20:19:04 2004 +0000
+++ b/devel/zlib/buildlink2.mk Mon Jan 19 23:11:19 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.7 2003/03/05 13:05:44 salo Exp $
+# $NetBSD: buildlink2.mk,v 1.8 2004/01/19 23:11:19 jlam Exp $
.if !defined(ZLIB_BUILDLINK2_MK)
ZLIB_BUILDLINK2_MK= # defined
@@ -8,46 +8,79 @@
BUILDLINK_DEPENDS.zlib?= zlib>=1.1.4nb1
BUILDLINK_PKGSRCDIR.zlib?= ../../devel/zlib
-.if defined(USE_ZLIB)
-_NEED_ZLIB= YES
-.else
-. if exists(/usr/include/zlib.h)
-_NEED_ZLIB= NO
-. else
-_NEED_ZLIB= YES
-. endif
-#
-# Solaris has a broken (for the purposes of pkgsrc) version of zlib.
-#
-_INCOMPAT_ZLIB= SunOS-*-*
-
-# So does IRIX
-_INCOMPAT_ZLIB+= IRIX-*-*
+_ZLIB_H= /usr/include/zlib.h
-# So does Darwin
-_INCOMPAT_ZLIB+= Darwin-*-*
-
-# So does Linux
-_INCOMPAT_ZLIB+= Linux-*-*
+.if !defined(BUILDLINK_IS_BUILTIN.zlib)
+BUILDLINK_IS_BUILTIN.zlib= NO
+. if exists(${_ZLIB_H})
+BUILDLINK_IS_BUILTIN.zlib= YES
+. endif
+.endif
-#
-# Some NetBSD versions shipped with versions lower than 1.1.3.
-#
-_INCOMPAT_ZLIB+= NetBSD-0.*-* NetBSD-1.[012]*-*
-_INCOMPAT_ZLIB+= NetBSD-1.3-* NetBSD-1.3.*-* NetBSD-1.3[A-H]-*
-
-INCOMPAT_ZLIB?= # empty
-. for _pattern_ in ${_INCOMPAT_ZLIB} ${INCOMPAT_ZLIB}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-_NEED_ZLIB= YES
-. endif
-. endfor
+.if defined(USE_ZLIB)
+BUILDLINK_USE_BUILTIN.zlib= NO
.endif
-.if ${_NEED_ZLIB} == "YES"
+.if !defined(BUILDLINK_USE_BUILTIN.zlib)
+. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[nN][oO])
+BUILDLINK_USE_BUILTIN.zlib= NO
+. else
+BUILDLINK_USE_BUILTIN.zlib= YES
+#
+# 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.
+#
+_ZLIB_VERSION!= \
+ ${AWK} '/\#define[ ]*ZLIB_VERSION/ { \
+ vers = $$3; \
+ gsub("\"", "", vers); \
+ print vers; \
+ } \
+ ' ${_ZLIB_H}
+_ZLIB_PKG= zlib-${_ZLIB_VERSION}
+#
+# If the built-in zlib is 1.1.4, then check whether it has the security
+# fix for CAN-2003-0107, which was a buffer overflow in the gzprintf
+# function. If it does, then treat it as the equivalent of zlib-1.1.4nb1.
+#
+_HAVE_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-*
+_HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
+#
+# XXX These patterns for {Free,Open}BSD are too permissive, but I'm not
+# XXX sure which versions of those OSes provide secure versions of
+# XXX zlib-1.1.4.
+#
+_HAVE_CAN_2003_0107_FIX+= FreeBSD-*-* OpenBSD-*-*
+. if ${_ZLIB_VERSION} == "1.1.4"
+. for _pattern_ in ${_HAVE_CAN_2003_0107_FIX}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_ZLIB_PKG= zlib-1.1.4nb1
+. endif
+. endfor
+. endif
+
+_ZLIB_DEPENDS= ${BUILDLINK_DEPENDS.zlib}
+BUILDLINK_USE_BUILTIN.zlib!= \
+ if ${PKG_ADMIN} pmatch '${_ZLIB_DEPENDS}' ${_ZLIB_PKG}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
+. endif
+MAKEFLAGS+= BUILDLINK_USE_BUILTIN.zlib="${BUILDLINK_USE_BUILTIN.zlib}"
+.endif
+
+.if !empty(BUILDLINK_USE_BUILTIN.zlib:M[nN][oO])
BUILDLINK_PACKAGES+= zlib
-EVAL_PREFIX+= BUILDLINK_PREFIX.zlib=zlib
+EVAL_PREFIX+= BUILDLINK_PREFIX.zlib=zlib
BUILDLINK_PREFIX.zlib_DEFAULT= ${LOCALBASE}
+#
+# If we depend on the package, depend on the latest version with a library
+# major number bump.
+#
+BUILDLINK_DEPENDS.zlib= zlib>=1.2.1
_BLNK_ZLIB_LDFLAGS= -L${BUILDLINK_PREFIX.zlib}/lib -lz
.else
BUILDLINK_PREFIX.zlib= /usr
diff -r 3429ea56deee -r eddee2387110 devel/zlib/buildlink3.mk
--- a/devel/zlib/buildlink3.mk Mon Jan 19 20:19:04 2004 +0000
+++ b/devel/zlib/buildlink3.mk Mon Jan 19 23:11:19 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.4 2004/01/05 11:05:45 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.5 2004/01/19 23:11:19 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
ZLIB_BUILDLINK3_MK:= ${ZLIB_BUILDLINK3_MK}+
@@ -13,9 +13,11 @@
BUILDLINK_CHECK_BUILTIN.zlib?= NO
+_ZLIB_H= /usr/include/zlib.h
+
.if !defined(BUILDLINK_IS_BUILTIN.zlib)
BUILDLINK_IS_BUILTIN.zlib= NO
-. if exists(/usr/include/zlib.h)
+. if exists(${_ZLIB_H})
BUILDLINK_IS_BUILTIN.zlib= YES
. endif
.endif
@@ -34,30 +36,57 @@
. else
BUILDLINK_USE_BUILTIN.zlib= YES
#
-# The listed platforms have a broken (for the purposes of pkgsrc) version
-# of this package.
+# 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.
#
-_INCOMPAT_ZLIB= SunOS-*-*
-_INCOMPAT_ZLIB+= IRIX-*-*
-_INCOMPAT_ZLIB+= Darwin-*-*
-_INCOMPAT_ZLIB+= Linux-*-*
+_ZLIB_VERSION!= \
+ ${AWK} '/\#define[ ]*ZLIB_VERSION/ { \
+ vers = $$3; \
+ gsub("\"", "", vers); \
+ print vers; \
+ } \
+ ' ${_ZLIB_H}
+_ZLIB_PKG= zlib-${_ZLIB_VERSION}
#
-# Some NetBSD versions shipped with zlib versions lower than 1.1.3.
+# If the built-in zlib is 1.1.4, then check whether it has the security
+# fix for CAN-2003-0107, which was a buffer overflow in the gzprintf
+# function. If it does, then treat it as the equivalent of zlib-1.1.4nb1.
+#
+_HAVE_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-*
+_HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
#
-_INCOMPAT_ZLIB+= NetBSD-0.*-* NetBSD-1.[012]*-*
-_INCOMPAT_ZLIB+= NetBSD-1.3-* NetBSD-1.3.*-* NetBSD-1.3[A-H]-*
+# XXX These patterns for {Free,Open}BSD are too permissive, but I'm not
+# XXX sure which versions of those OSes provide secure versions of
+# XXX zlib-1.1.4.
+#
+_HAVE_CAN_2003_0107_FIX+= FreeBSD-*-* OpenBSD-*-*
+. if ${_ZLIB_VERSION} == "1.1.4"
+. for _pattern_ in ${_HAVE_CAN_2003_0107_FIX}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_ZLIB_PKG= zlib-1.1.4nb1
+. endif
+. endfor
+. endif
-INCOMPAT_ZLIB?= # empty
-. for _pattern_ in ${_INCOMPAT_ZLIB} ${INCOMPAT_ZLIB}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-BUILDLINK_USE_BUILTIN.zlib= NO
-. endif
-. endfor
+_ZLIB_DEPENDS= ${BUILDLINK_DEPENDS.zlib}
+BUILDLINK_USE_BUILTIN.zlib!= \
+ if ${PKG_ADMIN} pmatch '${_ZLIB_DEPENDS}' ${_ZLIB_PKG}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
. endif
MAKEFLAGS+= BUILDLINK_USE_BUILTIN.zlib="${BUILDLINK_USE_BUILTIN.zlib}"
.endif
.if !empty(BUILDLINK_USE_BUILTIN.zlib:M[nN][oO])
+#
+# If we depend on the package, depend on the latest version with a library
+# major number bump.
+#
+BUILDLINK_DEPENDS.zlib= zlib>=1.2.1
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= zlib
. endif
Home |
Main Index |
Thread Index |
Old Index