1 # $NetBSD: pam.buildlink3.mk,v 1.4 2005/04/25 14:21:47 tv Exp $
3 # This Makefile fragment is meant to be included by packages that
4 # require a PAM implementation. pam.buildlink3.mk will:
6 # * set PAMBASE to the base directory of the PAM files;
7 # * set PAM_TYPE to the PAM implementation used.
9 # There are two variables that can be used to tweak the selection of
10 # the PAM implementation:
12 # PAM_DEFAULT is a user-settable variable whose value is the default
13 # PAM implementation to use.
15 # PAM_ACCEPTED is a package-settable list of PAM implementations
16 # that may be used by the package.
19 PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
21 .include "../../mk/bsd.prefs.mk"
23 .if !empty(PAM_BUILDLINK3_MK:M+)
25 # This is an exhaustive list of all of the PAM implementations
26 # that may be used with PAM.buildlink3.mk, in order of precedence.
28 # OS conditionals can exclude implementations not available on
31 .if ${OPSYS} != "Interix"
35 .if ${OPSYS} != "Interix"
39 # builtin only, so no conditional needed
40 _PAM_PKGS+= solaris-pam
42 BUILDLINK_BUILTIN_MK.linux-pam= ../../security/PAM/builtin.mk
43 BUILDLINK_BUILTIN_MK.openpam= ../../security/openpam/builtin.mk
44 BUILDLINK_BUILTIN_MK.solaris-pam= ../../mk/solaris-pam.builtin.mk
46 # If we have a particular PAM implementation in the base system, then
47 # default to using that PAM type. Otherwise, default to "linux-pam".
49 . for _pam_ in ${_PAM_PKGS}
50 . if exists(${BUILDLINK_BUILTIN_MK.${_pam_}})
51 CHECK_BUILTIN.${_pam_}:= yes
52 . include "${BUILDLINK_BUILTIN_MK.${_pam_}}"
53 . if defined(IS_BUILTIN.${_pam_}) && \
54 !empty(IS_BUILTIN.${_pam_}:M[yY][eE][sS])
55 PAM_DEFAULT?= ${_pam_}
57 CHECK_BUILTIN.${_pam_}:= no
60 PAM_DEFAULT?= linux-pam
61 PAM_ACCEPTED?= ${_PAM_PKGS}
63 _PAM_DEFAULT= ${PAM_DEFAULT}
64 _PAM_ACCEPTED= ${PAM_ACCEPTED}
66 _PAM_TYPE?= ${_PAM_DEFAULT}
68 . if !empty(_PAM_ACCEPTED:M${_PAM_TYPE})
69 PAM_TYPE= ${_PAM_TYPE}
73 PAMBASE= ${BUILDLINK_PREFIX.${PAM_TYPE}}
77 .endif # PAM_BUILDLINK3_MK
79 .if ${PAM_TYPE} == "none"
81 "${_PAM_TYPE} is not an acceptable PAM type for ${PKGNAME}."
82 .elif ${PAM_TYPE} == "linux-pam"
83 . include "../../security/PAM/buildlink3.mk"
84 .elif ${PAM_TYPE} == "openpam"
85 . include "../../security/openpam/buildlink3.mk"
86 .elif ${PAM_TYPE} == "solaris-pam"
87 BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nsolaris-pam}
88 BUILDLINK_PACKAGES+= solaris-pam