summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorjlam <jlam>2002-06-20 20:15:46 +0000
committerjlam <jlam>2002-06-20 20:15:46 +0000
commit9b0faae6391e74c4a2b5b1fde987d7952cb13dfb (patch)
tree15d25b0a8c8441b4d22c4a75ae86412dc8954ee3 /mk/bsd.pkg.mk
parentc7dfe7dd97617638fbded4913fa89a991416f665 (diff)
downloadpkgsrc-9b0faae6391e74c4a2b5b1fde987d7952cb13dfb.tar.gz
In order to solve the following problems:
(1) Admins want to create users/groups on their own (pkg/17183). (2) Admins don't want packages to setup an initial configuration. The bsd.pkg.install.mk-generated INSTALL/DEINSTALL scripts have been modified to check certain PKG_* environment variables to tune their behaviour. This works whether installing from "make install" or from a binary package. PKG_CREATE_USERGROUP indicates whether the INSTALL script should automatically add any needed users/groups to the system using useradd/groupadd. It is either YES or NO, and defaults to YES. PKG_CONFIG indicates whether the INSTALL/DEINSTALL scripts should do automatic config file and directory handling, or if it should merely inform the admin of the list of required files and directories needed to use the package. It is either YES or NO, and defaults to YES. The make(1) variable INSTALL_RCD_SCRIPTS is removed. The package rc.d script is now handled like other config files for the package, and is copied into place if PKG_CONFIG=YES. The default values above reflect the current behaviour. Setting PKG_CREATE_USERGROUP=NO solves problem (1), and setting PKG_CONFIG=NO solves problem (2). To simply matters for users installing directly from pkgsrc, these variables may also be defined in /etc/mk.conf, but behaviour at deinstall time may be surprising. It is *HIGHLY* recommended that these values be set in the shell environment instead.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk13
1 files changed, 10 insertions, 3 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index e6a3a54e72d..c982ad6df23 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.992 2002/06/17 09:11:10 grant Exp $
+# $NetBSD: bsd.pkg.mk,v 1.993 2002/06/20 20:15:48 jlam Exp $
#
# This file is in the public domain.
#
@@ -1921,6 +1921,13 @@ do-build:
# Install
+.if defined(PKG_CREATE_USERGROUP)
+INSTALL_SCRIPT_ENV+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP}
+.endif
+.if defined(PKG_CONFIG)
+INSTALL_SCRIPT_ENV+= PKG_CONFIG=${PKG_CONFIG}
+.endif
+
.if !target(do-install)
do-install:
${_PKG_SILENT}${_PKG_DEBUG}cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} ${INSTALL_TARGET}
@@ -2042,11 +2049,11 @@ real-su-install: ${MESSAGE}
${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
fi
.endif # !NO_MTREE
- ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} pre-install-script
+ ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${INSTALL_SCRIPT_ENV} ${MAKE} ${MAKEFLAGS} pre-install-script
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} pre-install
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} do-install
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} post-install
- ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} post-install-script
+ ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${INSTALL_SCRIPT_ENV} ${MAKE} ${MAKEFLAGS} post-install-script
.for f in ${INFO_FILES}
${_PKG_SILENT}${_PKG_DEBUG}${ECHO} "${INSTALL_INFO} --info-dir=${PREFIX}/info ${PREFIX}/info/${f}"; \
${INSTALL_INFO} --remove --info-dir=${PREFIX}/info ${PREFIX}/info/${f}; \