summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-03-14 01:14:26 +0000
committerjlam <jlam@pkgsrc.org>2006-03-14 01:14:26 +0000
commitdaad0f3d6ce8b344ce91e35e98ea05abf8e03f2d (patch)
tree2d76c0a00d07e0939789aa971b834f332c4820c3 /mk/bsd.pkg.mk
parentb1472309671a67b16cab03410ae83bb9d6007baa (diff)
downloadpkgsrc-daad0f3d6ce8b344ce91e35e98ea05abf8e03f2d.tar.gz
Modify the pkginstall framework so that it manages all aspects of
INSTALL/DEINSTALL script creation within pkgsrc. If an INSTALL or DEINSTALL script is found in the package directory, it is automatically used as a template for the pkginstall-generated scripts. If instead, they should be used simply as the full scripts, then the package Makefile should set INSTALL_SRC or DEINSTALL_SRC explicitly, e.g.: INSTALL_SRC= ${PKGDIR}/INSTALL DEINSTALL_SRC= # emtpy As part of the restructuring of the pkginstall framework internals, we now *always* generate temporary INSTALL or DEINSTALL scripts. By comparing these temporary scripts with minimal INSTALL/DEINSTALL scripts formed from only the base templates, we determine whether or not the INSTALL/DEINSTALL scripts are actually needed by the package (see the generate-install-scripts target in bsd.pkginstall.mk). In addition, more variables in the framework have been made private. The *_EXTRA_TMPL variables have been renamed to *_TEMPLATE, which are more sensible names given the very few exported variables in this framework. The only public variables relating to the templates are: INSTALL_SRC INSTALL_TEMPLATE DEINSTALL_SRC DEINSTALL_TEMPLATE HEADER_TEMPLATE The packages in pkgsrc have been modified to reflect the changes in the pkginstall framework.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk37
1 files changed, 9 insertions, 28 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 3a24e0a68ec..35deb3a15ee 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1806 2006/03/12 14:55:18 rillig Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1807 2006/03/14 01:14:35 jlam Exp $
#
# This file is in the public domain.
#
@@ -420,18 +420,9 @@ SCRIPTS_ENV+= ${INSTALL_MACROS}
#
.include "../../mk/alternatives.mk"
+# INSTALL/DEINSTALL script framework
.include "../../mk/install/bsd.pkginstall.mk"
-# Set INSTALL_FILE to be the name of any INSTALL file
-.if !defined(INSTALL_FILE) && exists(${PKGDIR}/INSTALL)
-INSTALL_FILE= ${PKGDIR}/INSTALL
-.endif
-
-# Set DEINSTALL_FILE to be the name of any DEINSTALL file
-.if !defined(DEINSTALL_FILE) && exists(${PKGDIR}/DEINSTALL)
-DEINSTALL_FILE= ${PKGDIR}/DEINSTALL
-.endif
-
# If MESSAGE hasn't been defined, then set MESSAGE_SRC to be a space-separated
# list of files to be concatenated together to generate the MESSAGE file.
#
@@ -512,8 +503,12 @@ PKG_ARGS_COMMON+= -P "`${MAKE} ${MAKEFLAGS} run-depends-list | ${SORT} -u`"
. if defined(CONFLICTS) && (${PKG_INSTALLATION_TYPE} == "overwrite")
PKG_ARGS_COMMON+= -C "${CONFLICTS}"
. endif
-PKG_ARGS_COMMON+= ${INSTALL_FILE:D-i ${INSTALL_FILE}}
-PKG_ARGS_COMMON+= ${DEINSTALL_FILE:D-k ${DEINSTALL_FILE}}
+. if defined(INSTALL_FILE) && exists(${INSTALL_FILE})
+PKG_ARGS_COMMON+= -i ${INSTALL_FILE}
+. endif
+. if defined(DEINSTALL_FILE) && exists(${DEINSTALL_FILE})
+PKG_ARGS_COMMON+= -k ${DEINSTALL_FILE}
+. endif
PKG_ARGS_COMMON+= ${MESSAGE:D-D ${MESSAGE}}
PKG_ARGS_COMMON+= ${NO_MTREE:D:U-m ${MTREE_FILE}}
PKG_ARGS_COMMON+= ${PKG_PRESERVE:D-n ${PRESERVE_FILE}}
@@ -2334,7 +2329,7 @@ do-su-undo-replace:
# Empty pre-* and post-* targets
-.for name in fetch tools wrapper configure build test install-script install package
+.for name in fetch tools wrapper configure build test install package
. if !target(pre-${name})
pre-${name}:
@@ -3562,20 +3557,6 @@ post-install-fake-pkg: ${PLIST} ${DESCR} ${MESSAGE}
case ${PKG_INSTALLATION_TYPE} in \
pkgview) ${TOUCH} ${PKG_DB_TMPDIR}/+VIEWS ;; \
esac
- ${_PKG_SILENT}${_PKG_DEBUG} \
- case "${INSTALL_FILE}" in \
- ${PKG_DB_TMPDIR}/*|"") ;; \
- *) if ${TEST} -f ${INSTALL_FILE}; then \
- ${CP} ${INSTALL_FILE} ${PKG_DB_TMPDIR}/+INSTALL; \
- fi ;; \
- esac
- ${_PKG_SILENT}${_PKG_DEBUG} \
- case "${DEINSTALL_FILE}" in \
- ${PKG_DB_TMPDIR}/*|"") ;; \
- *) if ${TEST} -f ${DEINSTALL_FILE}; then \
- ${CP} ${DEINSTALL_FILE} ${PKG_DB_TMPDIR}/+DEINSTALL; \
- fi ;; \
- esac
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${SIZE_PKG_FILE} ${SIZE_ALL_FILE}
. if ${SHLIB_HANDLING} == "YES" && ${CHECK_SHLIBS} == "YES"
${_PKG_SILENT}${_PKG_DEBUG} \