diff options
author | jlam <jlam> | 2002-10-20 09:10:42 +0000 |
---|---|---|
committer | jlam <jlam> | 2002-10-20 09:10:42 +0000 |
commit | 839b5352fdcc847ddf261c8bfcbd50beb563f19b (patch) | |
tree | ee56f68164f5a6abe71b0f958c25b24180e1f0ec /mk | |
parent | c5de0c44362cbabf079958b9aa79e3b303247b9d (diff) | |
download | pkgsrc-839b5352fdcc847ddf261c8bfcbd50beb563f19b.tar.gz |
Generate the INSTALL/DEINSTALL scripts at post-build time, and use proper
make dependencies to ensure that the actual scripts are up-to-date if the
sources are changed.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.install.mk | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk index 1f0a325aaec..66b75ececf3 100644 --- a/mk/bsd.pkg.install.mk +++ b/mk/bsd.pkg.install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.install.mk,v 1.34 2002/10/20 04:11:39 jlam Exp $ +# $NetBSD: bsd.pkg.install.mk,v 1.35 2002/10/20 09:10:42 jlam Exp $ # # This Makefile fragment is included by package Makefiles to use the common # INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply: @@ -260,13 +260,24 @@ post-install-script: install-rcd-scripts ${_PKG_SILENT}${_PKG_DEBUG}${SETENV} ${INSTALL_SCRIPTS_ENV} \ ${_PKG_DEBUG_SCRIPT} ${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} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${INSTALL_SRC} | \ - ${SED} ${FILES_SUBST_SED} > ${INSTALL_FILE} - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${INSTALL_FILE} +post-build: generate-install-scripts +generate-install-scripts: # do nothing + +.if !empty(DEINSTALL_SRC) +generate-install-scripts: ${DEINSTALL_FILE} +${DEINSTALL_FILE}: ${DEINSTALL_SRC} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \ + ${SED} ${FILES_SUBST_SED} > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +.endif + +.if !empty(INSTALL_SRC) +generate-install-scripts: ${INSTALL_FILE} +${INSTALL_FILE}: ${INSTALL_SRC} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \ + ${SED} ${FILES_SUBST_SED} > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +.endif # rc.d scripts are automatically generated and installed into the rc.d # scripts example directory at the post-install step. The following |