From 5c5cb301f3b68ff9f271c5f50999f04ddd86ede3 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 8 Oct 2006 20:31:38 +0000 Subject: Added a new variable MAKE_PACKAGE_AS_ROOT that controls whether the package needs to be packed by root or whether the unprivileged user can do that as well. Most packages don't need root privileges, but the default value is nevertheless "yes" to not break too many existing packages. pkgsrc users are encouraged to add the following to their mk.conf: MAKE_PACKAGES_AS_ROOT?= no The "?=" operator here is important because after the testing phase, this variable is only intended to be set by packages. If "=" would be used instead, packages could not override the value. --- mk/package/bsd.package.mk | 15 ++++++++++++++- mk/package/package.mk | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'mk/package') diff --git a/mk/package/bsd.package.mk b/mk/package/bsd.package.mk index 4c1530f0c7b..91f4d112675 100644 --- a/mk/package/bsd.package.mk +++ b/mk/package/bsd.package.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.package.mk,v 1.7 2006/07/22 16:31:35 jlam Exp $ +# $NetBSD: bsd.package.mk,v 1.8 2006/10/08 20:31:38 rillig Exp $ # # This Makefile fragment is included by bsd.pkg.mk and provides all # variables and targets related to binary packages. @@ -7,6 +7,19 @@ # # package, repackage # +# The following variables may be set by the package: +# +# MAKE_PACKAGE_AS_ROOT: YesNo +# When this variable is set to "no", the package is created by +# the user that also built the package. Since most packages don't +# need root privileges to create the package, the default value +# is "no". Packages that install unreadable files (for example +# with mode 4111) need to set this variable to "yes". +# +# Default value: "yes", but this will change to "no" after most +# packages that really need this option have been identified. + +MAKE_PACKAGE_AS_ROOT?= yes _COOKIE.package= ${WRKDIR}/.package_done diff --git a/mk/package/package.mk b/mk/package/package.mk index e956f751d37..8b4920b4d13 100644 --- a/mk/package/package.mk +++ b/mk/package/package.mk @@ -1,4 +1,4 @@ -# $NetBSD: package.mk,v 1.15 2006/07/22 16:31:35 jlam Exp $ +# $NetBSD: package.mk,v 1.16 2006/10/08 20:31:38 rillig Exp $ ###################################################################### ### package (PUBLIC) @@ -83,8 +83,12 @@ _PACKAGE_ALL_TARGETS+= package-warnings _PACKAGE_ALL_TARGETS+= error-check .PHONY: package-all su-package-all +.if !empty(MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss]) package-all: su-target su-package-all: ${_PACKAGE_ALL_TARGETS} +.else +package-all: ${_PACKAGE_ALL_TARGETS} +.endif ###################################################################### ### package-check-installed (PRIVATE, override) -- cgit v1.2.3