diff options
author | jlam <jlam@pkgsrc.org> | 2006-04-29 03:09:40 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-04-29 03:09:40 +0000 |
commit | 0022419f9dd7c566b686bc0f450be066440a69d1 (patch) | |
tree | 0afaf12afd4a2bf44387eec88ea36f8952b1de47 /mk | |
parent | c277c06d1f1f067fa69b6cef548383e3f30c5f56 (diff) | |
download | pkgsrc-0022419f9dd7c566b686bc0f450be066440a69d1.tar.gz |
Allow for just-in-time su when creating users and groups if
USERGROUP_PHASE is defined.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/install/bsd.pkginstall.mk | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk index 80a08b0fdb5..2c2df47d95d 100644 --- a/mk/install/bsd.pkginstall.mk +++ b/mk/install/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.50 2006/04/26 05:58:47 jlam Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.51 2006/04/29 03:09:40 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -264,9 +264,9 @@ ${_INSTALL_USERGROUP_UNPACKER}: \ .if defined(USERGROUP_PHASE) . if !empty(USERGROUP_PHASE:M*configure) -pre-configure: create-usergroup +pre-configure: do-su-create-usergroup . elif !empty(USERGROUP_PHASE:M*build) -pre-build: create-usergroup +pre-build: do-su-create-usergroup . endif .endif @@ -274,13 +274,21 @@ _INSTALL_USERGROUP_CHECK= \ ${SETENV} PERL5=${PERL5:Q} \ ${SH} ${PKGSRCDIR}/mk/install/usergroup-check -.PHONY: create-usergroup -create-usergroup: ${_INSTALL_USERGROUP_UNPACKER} +.PHONY: do-su-create-usergroup +do-su-create-usergroup: + @${ECHO_MSG} "${_PKGSRC_IN}> Requiring users and groups for ${PKGNAME}" ${_PKG_SILENT}${_PKG_DEBUG} \ if ${_INSTALL_USERGROUP_CHECK} -g ${_PKG_GROUPS:C/\:*$//} && \ ${_INSTALL_USERGROUP_CHECK} -u ${_PKG_USERS:C/\:*$//}; then \ exit 0; \ fi; \ + realtarget="create-usergroup"; \ + action="create-usergroup"; \ + ${_SU_TARGET} + +.PHONY: create-usergroup +create-usergroup: ${_INSTALL_USERGROUP_UNPACKER} + ${_PKG_SILENT}${_PKG_DEBUG} \ cd ${_PKGINSTALL_DIR} && \ ${SH} ${_INSTALL_USERGROUP_UNPACKER} && \ ${TEST} -f ./+USERGROUP && \ |