summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2006-10-09 11:59:08 +0000
committerjoerg <joerg@pkgsrc.org>2006-10-09 11:59:08 +0000
commitc4170bda15ee54fd5095d9f81bc37151f1d41440 (patch)
tree8269f16bb8219adc21f8a54b0affa344ebae175b /mk
parent37ef523ed618d86e403b66e807628df7e67c9d1a (diff)
downloadpkgsrc-c4170bda15ee54fd5095d9f81bc37151f1d41440.tar.gz
Add variable to control whether the install target is run as root.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk4
-rw-r--r--mk/install/install.mk6
2 files changed, 8 insertions, 2 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 52094248522..39077cb81eb 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.239 2006/10/09 11:44:06 joerg Exp $
+# $NetBSD: bsd.prefs.mk,v 1.240 2006/10/09 11:59:08 joerg Exp $
#
# Make file, included to get the site preferences, if any. Should
# only be included by package Makefiles before any .if defined()
@@ -328,6 +328,8 @@ PKGDIRMODE?= 755
_MAKE_CLEAN_AS_ROOT?= no
# Whether to run the clean target as root.
+_MAKE_INSTALL_AS_ROOT?= yes
+# Whether to run the install target as root.
_MAKE_PACKAGE_AS_ROOT?= yes
# Whether to run the package target as root.
diff --git a/mk/install/install.mk b/mk/install/install.mk
index 239e0d806ee..a09fde24288 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.20 2006/10/06 20:13:10 rillig Exp $
+# $NetBSD: install.mk,v 1.21 2006/10/09 11:59:08 joerg Exp $
######################################################################
### install (PUBLIC)
@@ -163,7 +163,11 @@ privileged-install-hook: check-interpreter
.endif
.PHONY: install-all su-install-all
+. if !empty(_MAKE_INSTALL_AS_ROOT:M[Yy][Ee][Ss])
install-all: su-target
+. else
+install-all: su-install-all
+. endif
su-install-all: ${_INSTALL_ALL_TARGETS}
######################################################################