From d32bc02295649f444d715c517cd36a1478ab1b85 Mon Sep 17 00:00:00 2001 From: jlam Date: Thu, 13 Jan 2005 23:00:06 +0000 Subject: Add a builtin.mk file to check for a built-in version of openpam and to associate it with a PKGNAME. --- security/openpam/builtin.mk | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 security/openpam/builtin.mk (limited to 'security') diff --git a/security/openpam/builtin.mk b/security/openpam/builtin.mk new file mode 100644 index 00000000000..196ddd3c7bd --- /dev/null +++ b/security/openpam/builtin.mk @@ -0,0 +1,40 @@ +# $NetBSD: builtin.mk,v 1.1 2005/01/13 23:00:06 jlam Exp $ + +_SECURITY_OPENPAM_VERSION_H= /usr/include/security/openpam_version.h + +.if !defined(IS_BUILTIN.openapm) +IS_BUILTIN.openpam= no +. if empty(_SECURITY_OPENPAM_VERSION_H:M${LOCALBASE}/*) && \ + exists(${_SECURITY_OPENPAM_VERSION_H}) +IS_BUILTIN.openpam= yes +# +# Create an appropriate package name for the built-in software +# distributed with the system. This package name can be used to check +# against BUILDLINK_DEPENDS. to see if we need to install the +# pkgsrc version or if the built-in one is sufficient. +# +_OPENPAM_VERSION!= ${AWK} '/\#define[ ]*_OPENPAM_VERSION[ ]/ {print $$3; }' ${_SECURITY_OPENPAM_VERSION_H} +BUILTIN_PKG.openpam= openpam-${_OPENPAM_VERSION} +BUILDLINK_VARS+= BUILTIN_PKG.openpam +. endif +BUILDLINK_VARS+= IS_BUILTIN.openpam +.endif # IS_BUILTIN.openpam + +.if !defined(USE_BUILTIN.openpam) +USE_BUILTIN.openpam?= ${IS_BUILTIN.openpam} + +. if defined(BUILTIN_PKG.openpam) +USE_BUILTIN.openpam= yes +. for _depend_ in ${BUILDLINK_DEPENDS.openpam} +. if !empty(USE_BUILTIN.openpam:M[yY][eE][sS]) +USE_BUILTIN.openpam!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.openpam}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +BUILDLINK_VARS+= USE_BUILTIN.openpam +.endif # USE_BUILTIN.openpam -- cgit v1.2.3