summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-09-12 10:54:49 +0000
committerjlam <jlam@pkgsrc.org>2003-09-12 10:54:49 +0000
commitefc1b569dc2fbc6a88025df74b2ccf2ba2c5ef73 (patch)
treea8548917f1d3c0eca1e0bdf4107d3a643427425b /mk
parentb49af05ceefd1a715429955f0ac069aff9b6d568 (diff)
downloadpkgsrc-efc1b569dc2fbc6a88025df74b2ccf2ba2c5ef73.tar.gz
Create two new variables:
DEFAULT_VIEW.${PKGBASE} default view for ${PKGBASE} VIEWBASE base location of files at run-time The first is meant to be set by package Makefiles or in /etc/mk.conf, while the latter is meant to read/used only. VIEWBASE is either ${LOCALBASE} or or ${LOCALBASE}/${DEFAULT_VIEW.${PKGBASE}} depending on whether the first variable is the empty string or not.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk18
1 files changed, 16 insertions, 2 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 37f78490ab5..ea50e10705f 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1271 2003/09/12 10:49:28 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1272 2003/09/12 10:54:49 jlam Exp $
#
# This file is in the public domain.
#
@@ -4443,7 +4443,21 @@ print-PLIST:
BUILD_VIEWS?= yes
.endif
-PKGVIEWS+= ${DEFAULT_VIEW}
+# DEFAULT_VIEW.${PKGBASE} default view for ${PKGBASE}
+# VIEWBASE base location of files at run-time
+#
+DEFAULT_VIEW.${PKGBASE}?= ${DEFAULT_VIEW}
+.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
+. if empty(DEFAULT_VIEW.${PKGBASE}:M"")
+VIEWBASE= ${LOCALBASE}/${DEFAULT_VIEW.${PKGBASE}}
+. else
+VIEWBASE= ${LOCALBASE}
+. endif
+.elif ${PKG_INSTALLATION_TYPE} == "overwrite"
+VIEWBASE= ${PREFIX}
+.endif
+
+PKGVIEWS+= ${DEFAULT_VIEW.${PKGBASE}}
# Fake installation of package so that user can pkg_delete it later.
# Also, make sure that an installed package is recognized correctly in