Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / pam.buildlink3.mk
blob45456203f09fdccad95823227aaf06f3bcf134ec
1 # $NetBSD: pam.buildlink3.mk,v 1.10 2007/10/13 11:04:16 dsl Exp $
3 # This Makefile fragment is meant to be included by packages that
4 # require a PAM implementation.
6 # User-settable variables:
8 # PAM_DEFAULT
9 # The preferred PAM implementation.
11 # Possible: linux-pam openpam solaris-pam
12 # Default: (from the base system, fallback: linux-pam)
14 # Package-settable variables:
16 # PAM_ACCEPTED
17 # The PAM implementations that this package can use.
19 # Possible: (see PAM_DEFAULT)
20 # Default: all
22 # System-provided variables:
24 # PAM_TYPE
25 # The PAM implementation that will be used for this package.
27 # PAMBASE
28 # The directory where the PAM implementation is installed.
31 PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
33 .include "bsd.fast.prefs.mk"
35 .if !empty(PAM_BUILDLINK3_MK:M+)
37 # This is an exhaustive list of all of the PAM implementations
38 # that may be used with PAM.buildlink3.mk, in order of precedence.
40 # OS conditionals can exclude implementations not available on
41 # some platforms.
43 .if ${OPSYS} != "Interix"
44 _PAM_PKGS+= linux-pam
45 .endif
47 .if ${OPSYS} != "Interix"
48 _PAM_PKGS+= openpam
49 .endif
51 # builtin only, so no conditional needed
52 _PAM_PKGS+= solaris-pam
54 BUILDLINK_BUILTIN_MK.linux-pam= ../../security/PAM/builtin.mk
55 BUILDLINK_BUILTIN_MK.openpam= ../../security/openpam/builtin.mk
56 BUILDLINK_BUILTIN_MK.solaris-pam= ../../mk/solaris-pam.builtin.mk
58 # If we have a particular PAM implementation in the base system, then
59 # default to using that PAM type. Otherwise, default to "linux-pam".
61 . for _pam_ in ${_PAM_PKGS}
62 . if exists(${BUILDLINK_BUILTIN_MK.${_pam_}})
63 CHECK_BUILTIN.${_pam_}:= yes
64 . include "${BUILDLINK_BUILTIN_MK.${_pam_}}"
65 . if defined(IS_BUILTIN.${_pam_}) && \
66 !empty(IS_BUILTIN.${_pam_}:M[yY][eE][sS])
67 PAM_DEFAULT?= ${_pam_}
68 . endif
69 CHECK_BUILTIN.${_pam_}:= no
70 . endif
71 . endfor
72 PAM_DEFAULT?= linux-pam
73 PAM_ACCEPTED?= ${_PAM_PKGS}
75 _PAM_DEFAULT= ${PAM_DEFAULT}
76 _PAM_ACCEPTED= ${PAM_ACCEPTED}
78 _PAM_TYPE?= ${_PAM_DEFAULT}
80 . if !empty(_PAM_ACCEPTED:M${_PAM_TYPE})
81 PAM_TYPE= ${_PAM_TYPE}
82 . else
83 PAM_TYPE= none
84 . endif
85 PAMBASE= ${BUILDLINK_PREFIX.${PAM_TYPE}}
87 BUILD_DEFS+= PAM_DEFAULT
88 BUILD_DEFS_EFFECTS+= PAMBASE PAM_TYPE
89 .endif # PAM_BUILDLINK3_MK
91 .if ${PAM_TYPE} == "none"
92 PKG_FAIL_REASON= \
93 "${_PAM_TYPE} is not an acceptable PAM type for ${PKGNAME}."
94 .elif ${PAM_TYPE} == "linux-pam"
95 . include "../../security/PAM/buildlink3.mk"
96 .elif ${PAM_TYPE} == "openpam"
97 . include "../../security/openpam/buildlink3.mk"
98 .elif ${PAM_TYPE} == "solaris-pam"
99 BUILDLINK_TREE+= solaris-pam -solaris-pam
100 .endif