diff options
author | jlam <jlam> | 2001-12-02 03:11:35 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-12-02 03:11:35 +0000 |
commit | 77f7fc5d39245d400e8ec79fa531f29c951fa641 (patch) | |
tree | 6957c1e8841b0717a421dbaf650bf82cdbb1aa9c /mk | |
parent | 8e64c09614956b3aa86da90bf9c23450d71dc47f (diff) | |
download | pkgsrc-77f7fc5d39245d400e8ec79fa531f29c951fa641.tar.gz |
Support automatically calling the INSTALL script during installation. This
currently only occurs for packages that use bsd.pkg.install.mk.
There are two new targets, pre-install-script and post-install-script, that
default to doing nothing. The order of targets called for a "make install"
is:
pre-install-script
pre-install
do-install
post-install
post-install-script
The new targets are defined in bsd.pkg.install.mk to call the INSTALL
script with the PRE-INSTALL and POST-INSTALL options.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.install.mk | 10 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk index cc0f1a2fe6d..a34132349ea 100644 --- a/mk/bsd.pkg.install.mk +++ b/mk/bsd.pkg.install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.install.mk,v 1.7 2001/11/26 20:37:38 jlam Exp $ +# $NetBSD: bsd.pkg.install.mk,v 1.8 2001/12/02 03:11:36 jlam Exp $ # # This Makefile fragment is included by package Makefiles to use the common # INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply: @@ -182,9 +182,13 @@ FILES_SUBST+= USERADD=${USERADD:Q} FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} -pre-install: install-scripts +pre-install-script: generate-install-scripts + PKG_PREFIX=${PREFIX} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL -install-scripts: +post-install-script: + PKG_PREFIX=${PREFIX} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL + +generate-install-scripts: ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${DEINSTALL_SRC} | \ ${SED} ${FILES_SUBST_SED} > ${DEINSTALL_FILE} ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${DEINSTALL_FILE} diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index e22fb19ec07..1467701216b 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.871 2001/11/30 05:03:06 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.872 2001/12/02 03:11:35 jlam Exp $ # # This file is in the public domain. # @@ -1742,9 +1742,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} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} pre-install-script ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} pre-install ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} do-install ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} post-install + ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${MAKE_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}; \ @@ -2124,7 +2126,7 @@ do-su-package: # Empty pre-* and post-* targets -.for name in fetch extract patch configure build install package +.for name in fetch extract patch configure build install-script install package . if !target(pre-${name}) pre-${name}: |