Create a pam.buildlink3.mk file that is used by PAM-using packages.

It includes the correct buildlink3.mk file from either Linux-PAM
(security/PAM) or OpenPAM (security/openpam) and eventually will
support solaris-pam.  pam.buildlink3.mk will:

	* set PAMBASE to the base directory of the PAM files;
	* set PAM_TYPE to the PAM implementation used.

There are two variables that can be used to tweak the selection of
the PAM implementation:

PAM_DEFAULT is a user-settable variable whose value is the default
	PAM implementation to use.

PAM_ACCEPTED is a package-settable list of PAM implementations
	that may be used by the package.

Modify most packages that include PAM/buildlink3.mk to include
pam.buildlink3.mk instead.
This commit is contained in:
jlam 2005-01-14 05:15:39 +00:00
parent fbeaab5d63
commit 1b5734f517
21 changed files with 121 additions and 45 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.4 2004/11/29 17:59:11 xtraeme Exp $
# $NetBSD: options.mk,v 1.5 2005/01/14 05:15:39 jlam Exp $
#
PKG_OPTIONS_VAR= PKG_OPTIONS.jabberd2
@ -31,5 +31,5 @@ CONFIGURE_ARGS+= --enable-ldap
.if !empty(PKG_OPTIONS:MPAM)
CONFIGURE_ARGS+= --enable-pam
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2004/12/28 02:47:43 reed Exp $
# $NetBSD: Makefile,v 1.7 2005/01/14 05:15:39 jlam Exp $
PKGNAME= postgresql73-server-${BASE_VERS}
PKGREVISION= 3
@ -25,7 +25,7 @@ BUILD_DIRS+= ${WRKSRC}/src/backend/utils/mb/conversion_procs
.include "../../mk/dlopen.buildlink3.mk"
.if defined(USE_PAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --with-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2004/12/28 02:47:43 reed Exp $
# $NetBSD: Makefile,v 1.9 2005/01/14 05:15:39 jlam Exp $
PKGNAME= postgresql74-server-${BASE_VERS}
PKGREVISION= 3
@ -24,7 +24,7 @@ BUILD_DIRS+= ${WRKSRC}/src/backend/utils/mb/conversion_procs
.include "../../mk/dlopen.buildlink3.mk"
.if defined(USE_PAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --with-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile.authdaemond,v 1.13 2004/07/14 21:37:09 jlam Exp $
# $NetBSD: Makefile.authdaemond,v 1.14 2005/01/14 05:15:39 jlam Exp $
USE_BUILDLINK3= yes
USE_LANGUAGES= c c++
@ -46,5 +46,5 @@ BUILD_DIRS= ${WRKSRC_SUBDIRS:S/^/${WRKSRC}\//}
.include "../../mk/bdb.buildlink3.mk"
.if defined(USE_PAM)
BUILD_DEFS+= USE_PAM
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
.endif

76
mk/pam.buildlink3.mk Normal file
View file

@ -0,0 +1,76 @@
# $NetBSD: pam.buildlink3.mk,v 1.1 2005/01/14 05:15:39 jlam Exp $
#
# This Makefile fragment is meant to be included by packages that
# require a PAM implementation. pam.buildlink3.mk will:
#
# * set PAMBASE to the base directory of the PAM files;
# * set PAM_TYPE to the PAM implementation used.
#
# There are two variables that can be used to tweak the selection of
# the PAM implementation:
#
# PAM_DEFAULT is a user-settable variable whose value is the default
# PAM implementation to use.
#
# PAM_ACCEPTED is a package-settable list of PAM implementations
# that may be used by the package.
#
PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
.include "../../mk/bsd.prefs.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.
#
_PAM_PKGS?= linux-pam openpam #solaris-pam
BUILDLINK_BUILTIN_MK.linux-pam= ../../security/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".
#
. for _pam_ in ${_PAM_PKGS}
. if exists(${BUILDLINK_BUILTIN_MK.${_pam_}})
CHECK_BUILTIN.${_pam_}:= yes
. include "${BUILDLINK_BUILTIN_MK.${_pam_}}"
. if defined(IS_BUILTIN.${_pam_}) && !empty(IS_BUILTIN.${_pam_})
PAM_DEFAULT?= ${_pam_}
. endif
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}
. if !empty(_PAM_ACCEPTED:M${_PAM_TYPE})
PAM_TYPE= ${_PAM_TYPE}
. else
PAM_TYPE= none
. endif
PAMBASE= ${BUILDLINK_PREFIX.${PAM_TYPE}}
BUILD_DEFS+= PAM_TYPE
BUILD_DEFS+= 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"
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nsolaris-pam}
BUILDLINK_PACKAGES+= solaris-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2004/12/28 02:47:46 reed Exp $
# $NetBSD: Makefile,v 1.32 2005/01/14 05:15:39 jlam Exp $
.include "Makefile.common"
@ -37,7 +37,7 @@ CONFIGURE_ARGS+= --enable-cups
.endif
.if defined(USE_PAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
BUILD_DEFS+= USE_PAM
CONFIGURE_ARGS+= --with-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.18 2004/12/28 02:47:47 reed Exp $
# $NetBSD: Makefile,v 1.19 2005/01/14 05:15:39 jlam Exp $
DISTNAME= proftpd-1.2.10
PKGREVISION= 1
@ -40,7 +40,7 @@ PKG_OPTIONS_VAR = PKG_OPTIONS.proftpd
.if !empty(PKG_OPTIONS:MPAM)
CONFIGURE_ARGS+= --enable-auth-pam
.include "../../security/PAM/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
.endif
.if !empty(PKG_OPTIONS:Mwrap)

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.17 2004/12/28 02:47:48 reed Exp $
# $NetBSD: Makefile,v 1.18 2005/01/14 05:15:39 jlam Exp $
.include "Makefile.common"
PKGREVISION= # empty1
@ -28,7 +28,7 @@ CONFIGURE_ARGS+= --enable-cups
.endif
.if defined(USE_PAM)
.include "../../security/PAM/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
BUILD_DEFS+= USE_PAM
CONFIGURE_ARGS+= --with-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.86 2005/01/06 07:26:39 jlam Exp $
# $NetBSD: Makefile,v 1.87 2005/01/14 05:15:39 jlam Exp $
#
# The CUPS author is very good about taking back changes into the main
# CUPS distribution. The correct place to send patches or bug-fixes is:
@ -62,7 +62,7 @@ PKG_SUPPORTED_OPTIONS= PAM
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:MPAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --enable-pam
MESSAGE_SRC= ${PKGDIR}/MESSAGE
MESSAGE_SRC+= ${PKGDIR}/MESSAGE.pam

View file

@ -1,14 +1,14 @@
# $NetBSD: module.mk,v 1.3 2005/01/14 00:08:46 jlam Exp $
# $NetBSD: module.mk,v 1.4 2005/01/14 05:15:39 jlam Exp $
.if !defined(PAM_MODULE_MK)
PAM_MODULE_MK= # defined
.if empty(USE_BUILDLINK3:M[nN][oO])
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
.endif
.if defined(DEFAULT_VIEW.linux-pam)
DEFAULT_VIEW.${PKGBASE}= ${DEFAULT_VIEW.linux-pam}
.if defined(DEFAULT_VIEW.${PAM_TYPE})
DEFAULT_VIEW.${PKGBASE}= ${DEFAULT_VIEW.${PAM_TYPE}}
.endif
PAM_MODULEDIR= ${VIEWBASE}/lib/security

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2005/01/14 00:08:46 jlam Exp $
# $NetBSD: Makefile,v 1.7 2005/01/14 05:15:39 jlam Exp $
PKGNAME= ${DISTNAME:S/cyrus-sasl/cy-login/}
PKGREVISION= 1
@ -13,9 +13,9 @@ SASL_PLUGIN= YES
CONFIGURE_ARGS+= --enable-login # LOGIN
CONFIGURE_ARGS+= --enable-plain # PLAIN
.if defined(USE_PAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
BUILD_DEFS+= USE_PAM
CONFIGURE_ARGS+= --with-pam=${BUILDLINK_PREFIX.linux-pam}
CONFIGURE_ARGS+= --with-pam=${PAMBASE}
.endif
BUILD_DIRS= ${WRKSRC}/plugins

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.47 2004/12/28 02:47:48 reed Exp $
# $NetBSD: Makefile,v 1.48 2005/01/14 05:15:39 jlam Exp $
.include "Makefile.common"
@ -23,8 +23,8 @@ PKG_SUPPORTED_OPTIONS= PAM gssapi kerberos
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:MPAM)
. include "../../security/PAM/buildlink3.mk"
CONFIGURE_ARGS+= --with-pam=${BUILDLINK_PREFIX.pam}
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --with-pam=${PAMBASE}
.endif
.if !empty(PKG_OPTIONS:Mkerberos)

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.5 2004/11/25 22:55:54 jlam Exp $
# $NetBSD: buildlink3.mk,v 1.6 2005/01/14 05:15:39 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
CYRUS_SASL_BUILDLINK3_MK:= ${CYRUS_SASL_BUILDLINK3_MK}+
@ -21,7 +21,7 @@ BUILDLINK_PKGSRCDIR.cyrus-sasl?= ../../security/cyrus-sasl
PKG_OPTIONS.cyrus-sasl?= ${PKG_DEFAULT_OPTIONS}
.if !empty(PKG_OPTIONS.cyrus-sasl:MPAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
.endif
# Cyrus SASL mechanisms are shared modules loaded via dlopen().

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.4 2005/01/14 00:08:46 jlam Exp $
# $NetBSD: options.mk,v 1.5 2005/01/14 05:15:40 jlam Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.cyrus-saslauthd
PKG_SUPPORTED_OPTIONS= PAM kerberos ldap gssapi
@ -8,8 +8,8 @@ PKG_SUPPORTED_OPTIONS= PAM kerberos ldap gssapi
### PAM (Pluggable Authentication Mechanism)
###
.if !empty(PKG_OPTIONS:MPAM)
. include "../../security/PAM/buildlink3.mk"
CONFIGURE_ARGS+= --with-pam=${BUILDLINK_PREFIX.linux-pam}
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --with-pam=${PAMBASE}
.endif
###

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.18 2004/12/28 02:47:49 reed Exp $
# $NetBSD: Makefile,v 1.19 2005/01/14 05:15:40 jlam Exp $
# NOTE: This package is modeled on ../openssh, but does not share
# files with it as that package may update faster than the gssapi
@ -74,7 +74,7 @@ CPPFLAGS+= -I/usr/include/krb5 -I/usr/include/kerberosIV
# XXX: why yet. For the moment, disable PAM authentication.
#
#.if defined(USE_PAM)
#.include "../../security/PAM/buildlink3.mk"
#.include "../../mk/pam.buildlink3.mk"
#CONFIGURE_ARGS+= --with-pam
#PLIST_SRC+= ${.CURDIR}/PLIST.pam
#MESSAGE_SRC+= ${.CURDIR}/MESSAGE.pam

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.2 2004/12/22 21:46:25 jlam Exp $
# $NetBSD: options.mk,v 1.3 2005/01/14 05:15:40 jlam Exp $
.include "../../mk/bsd.prefs.mk"
@ -25,7 +25,7 @@ PATCH_DIST_STRIP= -p1
.if !empty(PKG_OPTIONS:MPAM)
# XXX: PAM authentication causes memory faults, and haven't tracked down
# XXX: why yet. For the moment, disable PAM authentication for non-Linux.
.include "../../security/PAM/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --with-pam
PLIST_SRC+= ${.CURDIR}/PLIST.pam
MESSAGE_SRC+= ${.CURDIR}/MESSAGE.pam

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2004/11/15 17:54:50 jlam Exp $
# $NetBSD: Makefile,v 1.4 2005/01/14 05:15:40 jlam Exp $
#
DISTNAME= pam_dbm-0.2
@ -15,6 +15,6 @@ USE_PKGLOCALEDIR= yes
GNU_CONFIGURE= yes
BDB_ACCEPTED= db1
.include "../../security/PAM/buildlink3.mk"
.include "../../mk/bdb.buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.6 2004/12/22 04:36:33 jlam Exp $
# $NetBSD: options.mk,v 1.7 2005/01/14 05:15:40 jlam Exp $
#
PKG_OPTIONS_VAR= PKG_OPTIONS.sudo
@ -10,7 +10,7 @@ PKG_DEFAULT_OPTIONS+= skey
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:MPAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
DL_AUTO_VARS= yes
CONFIGURE_ARGS+= --with-pam
.endif

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2004/10/20 22:05:21 schmonz Exp $
# $NetBSD: Makefile,v 1.3 2005/01/14 05:15:40 jlam Exp $
#
DISTNAME= checkpassword-pam-0.99
@ -17,5 +17,5 @@ GNU_CONFIGURE= yes
INSTALLATION_DIRS= bin man/man8
.include "../../security/PAM/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2004/07/29 22:57:03 wiz Exp $
# $NetBSD: Makefile,v 1.9 2005/01/14 05:15:40 jlam Exp $
DISTNAME= mod_auth_pam-1.0a
PKGNAME= ap-auth-pam-1.0a
@ -24,6 +24,6 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/configure.html ${HTMLDIR}
${INSTALL_DATA} ${WRKSRC}/doc/faq.html ${HTMLDIR}
.include "../../security/PAM/buildlink3.mk"
.include "../../www/apache/module.mk"
.include "../../mk/pam.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.72 2004/12/28 21:51:12 jmmv Exp $
# $NetBSD: Makefile,v 1.73 2005/01/14 05:15:40 jlam Exp $
#
DISTNAME= gdm-2.6.0.6
@ -96,7 +96,7 @@ CONFIGURE_ARGS+= X_SERVER_ARGS="vt05"
BUILD_DEFS+= USE_PAM
.if defined(USE_PAM)
. include "../../security/PAM/buildlink3.mk"
. include "../../mk/pam.buildlink3.mk"
CONFIGURE_ARGS+= --enable-authentication-scheme=pam
PLIST_SUBST+= PAM_MISC=""
.elif exists(/etc/shadow)