summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorobache <obache>2011-03-21 04:52:18 +0000
committerobache <obache>2011-03-21 04:52:18 +0000
commit7f6651bf4ab41e2d25e665e8be97a155c534feec (patch)
treefcf2e94bdf2eb9e02b86f9693f65e250291973d3 /mk
parent5bd3fa6f65bba9e6388c731f73c10849d20daba4 (diff)
downloadpkgsrc-7f6651bf4ab41e2d25e665e8be97a155c534feec.tar.gz
Introduce DESTDIR_VARNAME package-settable variable.
A variable name that should be set as staged installation location presented as ${DESTDIR} at installation phase. "DESTDIR" is set by default. for packages using different variable for staged installation prefix, and/or using DESTDIR variable for different purpose.
Diffstat (limited to 'mk')
-rw-r--r--mk/install/install.mk13
1 files changed, 9 insertions, 4 deletions
diff --git a/mk/install/install.mk b/mk/install/install.mk
index fd14d25baf4..13b43c6c39e 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.59 2010/02/25 01:03:44 joerg Exp $
+# $NetBSD: install.mk,v 1.60 2011/03/21 04:52:18 obache Exp $
#
# This file provides the code for the "install" phase.
#
@@ -49,6 +49,10 @@
# When this variable is set to "yes", all directories mentioned
# in the PLIST files will be created like in INSTALLATION_DIRS.
#
+# DESTDIR_VARNAME
+# A variable name that should be set as staged installation location
+# presented as ${DESTDIR} at install phase.
+# "DESTDIR" is set by default.
######################################################################
### install (PUBLIC)
@@ -307,9 +311,10 @@ install-dirs-from-PLIST:
INSTALL_DIRS?= ${BUILD_DIRS}
INSTALL_MAKE_FLAGS?= # none
INSTALL_TARGET?= install ${USE_IMAKE:D${NO_INSTALL_MANPAGES:D:Uinstall.man}}
-.if ${_USE_DESTDIR} != "no"
-INSTALL_ENV+= DESTDIR=${DESTDIR:Q}
-INSTALL_MAKE_FLAGS+= DESTDIR=${DESTDIR:Q}
+DESTDIR_VARNAME?= "DESTDIR"
+.if ${_USE_DESTDIR} != "no" && !empty(DESTDIR_VARNAME)
+INSTALL_ENV+= ${DESTDIR_VARNAME}=${DESTDIR:Q}
+INSTALL_MAKE_FLAGS+= ${DESTDIR_VARNAME}=${DESTDIR:Q}
.endif
.if !target(do-install)