summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-05-17 04:44:44 +0000
committerjlam <jlam>2004-05-17 04:44:44 +0000
commita8af907fd901f833f0e9b7cc646f8b5f796a77b0 (patch)
tree482e2317814e8e67a90e6733351b5124c7316675 /mk
parent22e293ee835a05de012411cf415ca7f782280c1b (diff)
downloadpkgsrc-a8af907fd901f833f0e9b7cc646f8b5f796a77b0.tar.gz
Add a new package-settable variable, INSTALLATION_PREFIX, as discussed
with gavan@NetBSD.org at pkgsrcCon. Within the pkgsrc infrastructure, LOCALBASE has two different meanings: (1) where the package being built should be installed, and (2) where to find previously installed packages. Most instances of case (2) should be converted to use EVAL_PREFIX, but there are some cases where this is impossible. To resolve this, we preserve LOCALBASE to mean (2) and we create a new variable INSTALLATION_PREFIX to mean (1). INSTALLATION_PREFIX is meant to be set some time before bsd.pkg.mk is included, and provides the value for PREFIX if it's defined, e.g. NO_MTREE= yes INSTALLATION_PREFIX= / .include "../../mk/bsd.pkg.mk" This allows us to remove all cases where PREFIX is explicitly set in the package Makefile, e.g. Java VM packages, qmail, etc.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 1324baee08a..0152e3f99cf 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1459 2004/05/12 13:23:08 wiz Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1460 2004/05/17 04:44:44 jlam Exp $
#
# This file is in the public domain.
#
@@ -179,7 +179,9 @@ USE_X11?= implied
# Set the PREFIX appropriately.
.if ${PKG_INSTALLATION_TYPE} == "overwrite"
-. if defined(USE_X11BASE)
+. if defined(INSTALLATION_PREFIX)
+PREFIX= ${INSTALLATION_PREFIX}
+. elif defined(USE_X11BASE)
PREFIX= ${X11PREFIX}
. elif defined(USE_CROSSBASE)
PREFIX= ${CROSSBASE}
@@ -192,6 +194,10 @@ PREFIX= ${DEPOTBASE}/${PKGNAME}
NO_MTREE= yes
.endif
+.if (${PKG_INSTALLATION_TYPE} == "pkgviews") && defined(INSTALLATION_PREFIX)
+PKG_SKIP_REASON= "INSTALLATION_PREFIX can't be used in a pkgviews package"
+.endif
+
# If USE_XPKGWEDGE is set, then add a build dependency on xpkgwedge for
# X11 packages.
#