From 8e9056b23c547308d6034ab79f86cae5e206ba27 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 10 Apr 2006 15:04:44 +0000 Subject: Teach Kerberos 5 to detect the MIT Kerberos 5 bundled with Mac OS X. This stops the "gnome-vfs2" package from pulling in the "heimdal" package. This fixes PR pkg/29946 by Juha-Matti Liukkonen. --- mk/krb5.buildlink3.mk | 6 +++- security/mit-krb5/builtin.mk | 70 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 security/mit-krb5/builtin.mk diff --git a/mk/krb5.buildlink3.mk b/mk/krb5.buildlink3.mk index fa0c1225418..4478b652d0b 100644 --- a/mk/krb5.buildlink3.mk +++ b/mk/krb5.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: krb5.buildlink3.mk,v 1.8 2005/01/09 23:59:26 jlam Exp $ +# $NetBSD: krb5.buildlink3.mk,v 1.9 2006/04/10 15:04:44 tron Exp $ # # This Makefile fragment is meant to be included by packages that # require a Kerberos 5 implementation. krb5.buildlink3.mk will: @@ -20,7 +20,11 @@ KRB5_BUILDLINK3_MK:= ${KRB5_BUILDLINK3_MK}+ .include "../../mk/bsd.prefs.mk" .if !empty(KRB5_BUILDLINK3_MK:M+) +.if ${OPSYS} != Darwin KRB5_DEFAULT?= heimdal +.else +KRB5_DEFAULT?= mit-krb5 +.endif KRB5_ACCEPTED?= ${_KRB5_PKGS} # This is an exhaustive list of all of the Kerberos 5 implementations diff --git a/security/mit-krb5/builtin.mk b/security/mit-krb5/builtin.mk new file mode 100644 index 00000000000..ce0d50e7ac1 --- /dev/null +++ b/security/mit-krb5/builtin.mk @@ -0,0 +1,70 @@ +# $NetBSD: builtin.mk,v 1.1 2006/04/10 15:04:44 tron Exp $ + +BUILTIN_PKG:= mit-krb5 + +BUILTIN_FIND_FILES_VAR:= KRB5_CONFIG +BUILTIN_FIND_FILES.KRB5_CONFIG= /usr/bin/krb5-config + +.include "../../mk/buildlink3/bsd.builtin.mk" + +### +### Figure out the version of MIT Kerberos V installed on the system. +### + +.if !defined(BUILTIN_VERSION.mit-krb5) && \ + empty(KRB5_CONFIG:M__nonexistent__) && \ + empty(KRB5_CONFIG:M${LOCALBASE}/*) +BUILTIN_VERSION.mit-krb5!= ${KRB5_CONFIG} --version | \ + ${SED} -e 's/.*release //' -e 's/-.*//' +.endif +MAKEVARS+= BUILTIN_VERSION.mit-krb5 + +### +### Determine if there is a built-in implementation of the package and +### set IS_BUILTIN. appropriately ("yes" or "no"). +### +.if !defined(IS_BUILTIN.mit-krb5) +IS_BUILTIN.mit-krb5= no +. if defined(BUILTIN_VERSION.mit-krb5) +IS_BUILTIN.mit-krb5= yes +. endif +.endif +MAKEVARS+= IS_BUILTIN.mit-krb5 + +### +### If there is a built-in implementation, then set BUILTIN_PKG. to +### a package name to represent the built-in package. +### +.if !defined(BUILTIN_PKG.mit-krb5) && \ + !empty(IS_BUILTIN.mit-krb5:M[yY][eE][sS]) && \ + defined(BUILTIN_VERSION.mit-krb5) +BUILTIN_PKG.mit-krb5= mit-krb5-${BUILTIN_VERSION.mit-krb5} +.endif +MAKEVARS+= BUILTIN_PKG.mit-krb5 + +### +### Determine whether we should use the built-in implementation if it +### exists, and set USE_BUILTIN. appropriate ("yes" or "no"). +### +.if !defined(USE_BUILTIN.mit-krb5) +. if ${PREFER.mit-krb5} == "pkgsrc" +USE_BUILTIN.mit-krb5= no +. else +USE_BUILTIN.mit-krb5= ${IS_BUILTIN.mit-krb5} +. if defined(BUILTIN_PKG.mit-krb5) && \ + !empty(IS_BUILTIN.mit-krb5:M[yY][eE][sS]) +USE_BUILTIN.mit-krb5= yes +. for _dep_ in ${BUILDLINK_API_DEPENDS.mit-krb5} +. if !empty(USE_BUILTIN.mit-krb5:M[yY][eE][sS]) +USE_BUILTIN.mit-krb5!= \ + if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mit-krb5:Q}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +. endif +.endif +MAKEVARS+= USE_BUILTIN.mit-krb5 -- cgit v1.2.3