diff options
author | jlam <jlam@pkgsrc.org> | 2002-10-20 09:10:42 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-10-20 09:10:42 +0000 |
commit | 8f33914f7c4b95554434ec4b51fb8e17a179b32b (patch) | |
tree | ee56f68164f5a6abe71b0f958c25b24180e1f0ec /mk | |
parent | 753e15c6df176ce0f98a3e4db107695106bbd833 (diff) | |
download | pkgsrc-8f33914f7c4b95554434ec4b51fb8e17a179b32b.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 |