pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/package Added a new variable MAKE_PACKAGE_AS_ROOT t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0a5844851588
branches:  trunk
changeset: 519729:0a5844851588
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 08 20:31:38 2006 +0000

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

diffstat:

 mk/package/bsd.package.mk |  15 ++++++++++++++-
 mk/package/package.mk     |   6 +++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 33a61b4ca789 -r 0a5844851588 mk/package/bsd.package.mk
--- a/mk/package/bsd.package.mk Sun Oct 08 20:25:43 2006 +0000
+++ b/mk/package/bsd.package.mk Sun Oct 08 20:31:38 2006 +0000
@@ -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 -r 33a61b4ca789 -r 0a5844851588 mk/package/package.mk
--- a/mk/package/package.mk     Sun Oct 08 20:25:43 2006 +0000
+++ b/mk/package/package.mk     Sun Oct 08 20:31:38 2006 +0000
@@ -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+= 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)



Home | Main Index | Thread Index | Old Index