diff mbox

[resend,2/2] scripts/package: use fakeroot if available

Message ID 20091014065547.GB8771@progeny.tock (mailing list archive)
State New, archived
Headers show

Commit Message

Jonathan Nieder Oct. 14, 2009, 6:55 a.m. UTC
None
diff mbox

Patch

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 14b65a8..14fdeda 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -1,6 +1,15 @@ 
 # Makefile for the different targets used to generate full packages of a kernel
 # It uses the generic clean infrastructure of kbuild
 
+# How to acquire (fake) root privileges
+ifndef ROOTCMD
+ifneq ($(shell id -u),0)
+ifeq ($(shell which fakeroot >/dev/null 2>&1 && echo found),found)
+ROOTCMD := fakeroot -u
+endif
+endif
+endif
+
 # RPM target
 # ---------------------------------------------------------------------------
 # The rpm target generates two rpm files: