diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
commit | d0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /devel/zlib | |
parent | 9d61fef8537aed11013bf556e319b2d8e398a11b (diff) | |
download | pkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.tar.gz |
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal
checking for built-in software is much simpler to deal with in pkgsrc.
The buildlink3.mk file for a package will be of the usual format
regardless of the package, which makes it simpler for packagers to
update a package.
The builtin.mk file for a package must define a single yes/no variable
USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether
to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'devel/zlib')
-rw-r--r-- | devel/zlib/buildlink3.mk | 110 | ||||
-rw-r--r-- | devel/zlib/builtin.mk | 81 |
2 files changed, 88 insertions, 103 deletions
diff --git a/devel/zlib/buildlink3.mk b/devel/zlib/buildlink3.mk index c9f47b1d6e7..05772b6bf27 100644 --- a/devel/zlib/buildlink3.mk +++ b/devel/zlib/buildlink3.mk @@ -1,114 +1,18 @@ -# $NetBSD: buildlink3.mk,v 1.15 2004/02/18 16:35:27 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.16 2004/03/10 17:57:14 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ ZLIB_BUILDLINK3_MK:= ${ZLIB_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= zlib +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nzlib} +BUILDLINK_PACKAGES+= zlib .if !empty(ZLIB_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= zlib BUILDLINK_DEPENDS.zlib+= zlib>=1.1.4nb1 BUILDLINK_PKGSRCDIR.zlib?= ../../devel/zlib .endif # ZLIB_BUILDLINK3_MK -BUILDLINK_CHECK_BUILTIN.zlib?= NO - -_ZLIB_H= /usr/include/zlib.h - -.if !defined(BUILDLINK_IS_BUILTIN.zlib) -BUILDLINK_IS_BUILTIN.zlib= NO -. if exists(${_ZLIB_H}) -BUILDLINK_IS_BUILTIN.zlib= YES -. if !empty(BUILDLINK_CHECK_BUILTIN.zlib:M[nN][oO]) -# -# 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 -. for _depend_ in ${BUILDLINK_DEPENDS.zlib} -. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS]) -BUILDLINK_IS_BUILTIN.zlib!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${_ZLIB_PKG}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. endif -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.zlib=${BUILDLINK_IS_BUILTIN.zlib} -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.zlib:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.zlib= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.zlib) -. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.zlib= YES -. else -BUILDLINK_USE_BUILTIN.zlib= NO -. endif - -. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \ - !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.zlib= YES -. endif -. if !empty(PREFER_PKGSRC:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.zlib= NO -. endif -. if !empty(PREFER_NATIVE:Mzlib) && \ - !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.zlib= YES -. endif -. if !empty(PREFER_PKGSRC:Mzlib) -BUILDLINK_USE_BUILTIN.zlib= NO -. endif - -. if defined(USE_ZLIB) -BUILDLINK_USE_BUILTIN.zlib= NO -. endif -.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 -.endif - BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/devel/zlib/builtin.mk b/devel/zlib/builtin.mk new file mode 100644 index 00000000000..7df7fe471b4 --- /dev/null +++ b/devel/zlib/builtin.mk @@ -0,0 +1,81 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $ + +_ZLIB_H= /usr/include/zlib.h + +.if !defined(IS_BUILTIN.zlib) +IS_BUILTIN.zlib= no +. if exists(${_ZLIB_H}) +IS_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} +BUILTIN_PKG.zlib= 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_}) +BUILTIN_PKG.zlib= zlib-1.1.4nb1 +. endif +. endfor +. endif +MAKEFLAGS+= BUILTIN_PKG.zlib=${BUILTIN_PKG.zlib} +. endif +MAKEFLAGS+= IS_BUILTIN.zlib=${IS_BUILTIN.zlib} +.endif + +CHECK_BUILTIN.zlib?= no +.if !empty(CHECK_BUILTIN.zlib:M[yY][eE][sS]) +USE_BUILTIN.zlib= yes +.endif + +.if !defined(USE_BUILTIN.zlib) +USE_BUILTIN.zlib?= ${IS_BUILTIN.zlib} +PREFER.zlib?= pkgsrc + +. if defined(BUILTIN_PKG.zlib) +USE_BUILTIN.zlib= yes +. for _depend_ in ${BUILDLINK_DEPENDS.zlib} +. if !empty(USE_BUILTIN.zlib:M[yY][eE][sS]) +USE_BUILTIN.zlib!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.zlib}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif + +. if defined(USE_ZLIB) +. if !empty(IS_BUILTIN.zlib:M[nN][oO]) && \ + (${PREFER.zlib} == "pkgsrc") +USE_BUILTIN.zlib= no +. endif +. endif +.endif # USE_BUILTIN.zlib + +.if !empty(USE_BUILTIN.zlib:M[nN][oO]) +BUILDLINK_DEPENDS.zlib+= zlib>=1.2.1 +.endif |