summaryrefslogtreecommitdiff
path: root/mk/krb5.buildlink3.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-01-10 15:29:34 +0000
committerjlam <jlam@pkgsrc.org>2004-01-10 15:29:34 +0000
commitbcbdf1b81918b139cc8d6e9fd9fd4f19f950aea3 (patch)
treeadd589d35d546c6200eafac9bf1f8d127fa0b0da /mk/krb5.buildlink3.mk
parent7aeaf3cbda8d40b11d2103425968e2535f20e06b (diff)
downloadpkgsrc-bcbdf1b81918b139cc8d6e9fd9fd4f19f950aea3.tar.gz
First cut at a generic buildlink3.mk file to be included by packages that
need Kerberos 5. It includes heimdal/buildlink3.mk or mit-krb5/buildlink3.mk (not ready yet) appropriately.
Diffstat (limited to 'mk/krb5.buildlink3.mk')
-rw-r--r--mk/krb5.buildlink3.mk78
1 files changed, 78 insertions, 0 deletions
diff --git a/mk/krb5.buildlink3.mk b/mk/krb5.buildlink3.mk
new file mode 100644
index 00000000000..ac55596f0ad
--- /dev/null
+++ b/mk/krb5.buildlink3.mk
@@ -0,0 +1,78 @@
+# $NetBSD: krb5.buildlink3.mk,v 1.1 2004/01/10 15:29:34 jlam Exp $
+
+KRB5_BUILDLINK3_MK:= ${KRB5_BUILDLINK3_MK}+
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(KRB5_BUILDLINK3_MK)
+KRB5_DEFAULT?= # empty
+KRB5_ACCEPTED?= ${_KRB5_PKGS}
+
+# This is an exhaustive list of all of the Kerberos 5 implementations
+# that may be used with krb5.buildlink3.mk, in order of precedence.
+#
+_KRB5_PKGS?= heimdal #mit-krb5
+
+_KRB5_DEFAULT= ${KRB5_DEFAULT}
+_KRB5_ACCEPTED= ${KRB5_ACCEPTED}
+
+# Mark the acceptable Kerberos 5 packages and check which, if any, are
+# already installed.
+#
+. for _krb5_ in ${_KRB5_ACCEPTED}
+_KRB5_OK.${_krb5_}= yes
+. if !defined(_KRB5_INSTALLED.${_krb5_})
+_KRB5_INSTALLED.${_krb5_}!= \
+ if ${PKG_INFO} -qe ${_krb5_}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+MAKEFLAGS+= _KRB5_INSTALLED.${_krb5_}="${_KRB5_INSTALLED.${_krb5_}}"
+. endif
+. endfor
+
+. if !defined(_KRB5)
+#
+# Prefer the default one if it's accepted,...
+#
+. if !empty(_KRB5_DEFAULT) && \
+ defined(_KRB5_OK.${_KRB5_DEFAULT}) && \
+ !empty(_KRB5_OK.${_KRB5_DEFAULT}:M[yY][eE][sS])
+_KRB5= ${_KRB5_DEFAULT}
+. endif
+#
+# ...otherwise, use one of the installed Kerberos 5 packages,...
+#
+. for _krb5_ in ${_KRB5_ACCEPTED}
+. if !empty(_KRB5_INSTALLED.${_krb5_}:M[yY][eE][sS])
+_KRB5?= ${_krb5_}
+. else
+_KRB5_FIRSTACCEPTED?= ${_krb5_}
+. endif
+. endfor
+#
+# ...otherwise, just use the first accepted Kerberos 5 package.
+#
+. if defined(_KRB5_FIRSTACCEPTED)
+_KRB5?= ${_KRB5_FIRSTACCEPTED}
+. endif
+_KRB5?= none
+MAKEFLAGS+= _KRB5="${_KRB5}"
+. endif
+
+KRB5_TYPE= ${_KRB5}
+BUILD_DEFS+= KRB5_TYPE
+
+. if ${KRB5_TYPE} == "none"
+PKG_FAIL_REASON= "No acceptable Kerberos 5 implementation found."
+. elif ${KRB5_TYPE} == "heimdal"
+KRB5BASE= ${BUILDLINK_PREFIX.heimdal}
+. include "../../security/heimdal/buildlink3.mk"
+. elif ${KRB5_TYPE} == "mit-krb5"
+KRB5BASE= ${BUILDLINK_PREFIX.mit-krb5}
+. include "../../security/mit-krb5/buildlink3.mk"
+. endif
+BUILD_DEFS+= KRB5BASE
+
+.endif # KRB5_BUILDLINK3_MK