diff options
author | joerg <joerg@pkgsrc.org> | 2014-06-10 13:52:57 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2014-06-10 13:52:57 +0000 |
commit | c4f9d7ca57e3b22ffb9601b52420abc373060173 (patch) | |
tree | a0764b86c26958c7b18560274fffb5b0ae24ae15 | |
parent | 75ee2f6993f9ffb1cffb9c4b4b6abd59bd3ed9c2 (diff) | |
download | pkgsrc-c4f9d7ca57e3b22ffb9601b52420abc373060173.tar.gz |
Always use OpenPAM as fallback PAM implementation if a native one is
missing. Drop PAM_ACCEPTED and PAM_TYPE as unused or redundant.
-rw-r--r-- | mk/linux-pam.builtin.mk | 74 | ||||
-rw-r--r-- | mk/pam.buildlink3.mk | 63 | ||||
-rw-r--r-- | mk/platform/QNX.mk | 2 |
3 files changed, 88 insertions, 51 deletions
diff --git a/mk/linux-pam.builtin.mk b/mk/linux-pam.builtin.mk new file mode 100644 index 00000000000..1eb2bec5405 --- /dev/null +++ b/mk/linux-pam.builtin.mk @@ -0,0 +1,74 @@ +# $NetBSD: linux-pam.builtin.mk,v 1.1 2014/06/10 13:52:57 joerg Exp $ + +BUILTIN_PKG:= linux-pam + +BUILTIN_FIND_HEADERS_VAR:= H_LINUX_PAM +BUILTIN_FIND_HEADERS.H_LINUX_PAM= security/pam_appl.h \ + pam/pam_appl.h +BUILTIN_FIND_GREP.H_LINUX_PAM= The Linux-PAM Framework layer API + +.include "../../mk/buildlink3/bsd.builtin.mk" + +### +### Determine if there is a built-in implementation of the package and +### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). +### +.if !defined(IS_BUILTIN.linux-pam) +IS_BUILTIN.linux-pam= no +. if empty(H_LINUX_PAM:M__nonexistent__) && empty(H_LINUX_PAM:M${LOCALBASE}/*) +IS_BUILTIN.linux-pam= yes +. endif +.endif +MAKEVARS+= IS_BUILTIN.linux-pam + +### +### Determine whether we should use the built-in implementation if it +### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). +### +.if !defined(USE_BUILTIN.linux-pam) +. if ${PREFER.linux-pam} == "pkgsrc" +USE_BUILTIN.linux-pam= no +. else +USE_BUILTIN.linux-pam= ${IS_BUILTIN.linux-pam} +. if defined(BUILTIN_PKG.linux-pam) && \ + !empty(IS_BUILTIN.linux-pam:M[yY][eE][sS]) +USE_BUILTIN.linux-pam= yes +. for _dep_ in ${BUILDLINK_API_DEPENDS.linux-pam} +. if !empty(USE_BUILTIN.linux-pam:M[yY][eE][sS]) +USE_BUILTIN.linux-pam!= \ + if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.linux-pam:Q}; then \ + ${ECHO} yes; \ + else \ + ${ECHO} no; \ + fi +. endif +. endfor +. endif +. endif # PREFER.linux-pam +.endif +MAKEVARS+= USE_BUILTIN.linux-pam + +### +### The section below only applies if we are not including this file +### solely to determine whether a built-in implementation exists. +### +CHECK_BUILTIN.linux-pam?= no +.if !empty(CHECK_BUILTIN.linux-pam:M[nN][oO]) + +. if !empty(USE_BUILTIN.linux-pam:M[yY][eE][sS]) +BUILDLINK_TARGETS+= buildlink-pam-security +. endif + +. if !target(buildlink-pam-security) +.PHONY: buildlink-pam-security +buildlink-pam-security: + ${_PKG_SILENT}${_PKG_DEBUG} \ + src=${BUILDLINK_PREFIX.linux-pam:Q}"/include/pam"; \ + dest=${BUILDLINK_DIR:Q}"/include/security"; \ + if ${TEST} -d "$$src"; then \ + ${RM} -fr "$$dest"; \ + ${LN} -fs "$$src" "$$dest"; \ + fi +. endif + +.endif # CHECK_BUILTIN.linux-pam diff --git a/mk/pam.buildlink3.mk b/mk/pam.buildlink3.mk index eb838df2b77..c970654ec5f 100644 --- a/mk/pam.buildlink3.mk +++ b/mk/pam.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: pam.buildlink3.mk,v 1.11 2009/03/20 19:25:01 joerg Exp $ +# $NetBSD: pam.buildlink3.mk,v 1.12 2014/06/10 13:52:57 joerg Exp $ # # This Makefile fragment is meant to be included by packages that # require a PAM implementation. @@ -9,21 +9,12 @@ # The preferred PAM implementation. # # Possible: linux-pam openpam solaris-pam -# Default: (from the base system, fallback: linux-pam) +# Default: (from the base system, fallback: openpam) # # Package-settable variables: # -# PAM_ACCEPTED -# The PAM implementations that this package can use. -# -# Possible: (see PAM_DEFAULT) -# Default: all -# # System-provided variables: # -# PAM_TYPE -# The PAM implementation that will be used for this package. -# # PAMBASE # The directory where the PAM implementation is installed. # @@ -35,28 +26,16 @@ PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+ .if !empty(PAM_BUILDLINK3_MK:M+) # # This is an exhaustive list of all of the PAM implementations -# that may be used with PAM.buildlink3.mk, in order of precedence. -# -# OS conditionals can exclude implementations not available on -# some platforms. -# -.if ${OPSYS} != "Interix" -_PAM_PKGS+= linux-pam -.endif - -.if ${OPSYS} != "Interix" -_PAM_PKGS+= openpam -.endif +# that may be used with pam.buildlink3.mk, in order of precedence. -# builtin only, so no conditional needed -_PAM_PKGS+= solaris-pam +_PAM_PKGS= openpam linux-pam solaris-pam -BUILDLINK_BUILTIN_MK.linux-pam= ../../security/PAM/builtin.mk +BUILDLINK_BUILTIN_MK.linux-pam= ../../mk/linux-pam.builtin.mk BUILDLINK_BUILTIN_MK.openpam= ../../security/openpam/builtin.mk BUILDLINK_BUILTIN_MK.solaris-pam= ../../mk/solaris-pam.builtin.mk # If we have a particular PAM implementation in the base system, then -# default to using that PAM type. Otherwise, default to "linux-pam". +# default to using that PAM type. Otherwise, default to "openpam". # . for _pam_ in ${_PAM_PKGS} . if exists(${BUILDLINK_BUILTIN_MK.${_pam_}}) @@ -69,32 +48,18 @@ PAM_DEFAULT?= ${_pam_} CHECK_BUILTIN.${_pam_}:= no . endif . endfor -PAM_DEFAULT?= linux-pam -PAM_ACCEPTED?= ${_PAM_PKGS} - -_PAM_DEFAULT= ${PAM_DEFAULT} -_PAM_ACCEPTED= ${PAM_ACCEPTED} - -_PAM_TYPE?= ${_PAM_DEFAULT} +PAM_DEFAULT?= openpam -. if !empty(_PAM_ACCEPTED:M${_PAM_TYPE}) -PAM_TYPE= ${_PAM_TYPE} -. else -PAM_TYPE= none -. endif -PAMBASE= ${BUILDLINK_PREFIX.${PAM_TYPE}} +PAMBASE= ${BUILDLINK_PREFIX.${PAM_DEFAULT}} BUILD_DEFS+= PAM_DEFAULT -BUILD_DEFS_EFFECTS+= PAMBASE PAM_TYPE +BUILD_DEFS_EFFECTS+= PAMBASE .endif # PAM_BUILDLINK3_MK -.if ${PAM_TYPE} == "none" -PKG_FAIL_REASON= \ - "${_PAM_TYPE} is not an acceptable PAM type for ${PKGNAME}." -.elif ${PAM_TYPE} == "linux-pam" -. include "../../security/PAM/buildlink3.mk" -.elif ${PAM_TYPE} == "openpam" -. include "../../security/openpam/buildlink3.mk" -.elif ${PAM_TYPE} == "solaris-pam" +.if ${PAM_DEFAULT} == "openpam" +.include "../../security/openpam/buildlink3.mk" +.elif ${PAM_DEFAULT} == "linux-pam" +BUILDLINK_TREE+= linux-pam -linux-pam +.elif ${PAM_DEFAULT} == "solaris-pam" BUILDLINK_TREE+= solaris-pam -solaris-pam .endif diff --git a/mk/platform/QNX.mk b/mk/platform/QNX.mk index 48b7bcaa0ca..48ec46009ce 100644 --- a/mk/platform/QNX.mk +++ b/mk/platform/QNX.mk @@ -98,8 +98,6 @@ GAMEMODE= 2555 GAMEDIRMODE= 0775 .endif -PAM_DEFAULT?= openpam - _OPSYS_PREFER.zlib?= pkgsrc _OPSYS_PREFER.bzip2?= pkgsrc _OPSYS_PREFER.curses?= pkgsrc |