pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Create two new variables:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/857d6101a4f3
branches:  trunk
changeset: 461178:857d6101a4f3
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Sep 12 10:54:49 2003 +0000

description:
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:

 mk/bsd.pkg.mk |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 226d4698510d -r 857d6101a4f3 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Fri Sep 12 10:49:28 2003 +0000
+++ b/mk/bsd.pkg.mk     Fri Sep 12 10:54:49 2003 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index