I'm attaching an updated version of Davor's patch (against 1.14.5).

Note that this allows to do very useful things such as:

  dpkg-buildpackage -B -rfakeroot -M"make -j `getconf _NPROCESSORS_ONLN` -f"

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
diff -ur dpkg-1.14.5.old/scripts/dpkg-buildpackage.sh dpkg-1.14.5/scripts/dpkg-buildpackage.sh
--- dpkg-1.14.5.old/scripts/dpkg-buildpackage.sh	2007-06-19 12:11:37.000000000 +0000
+++ dpkg-1.14.5/scripts/dpkg-buildpackage.sh	2007-08-25 22:52:19.000000000 +0000
@@ -23,6 +23,7 @@
 Options:
   -r<gain-root-command>
   -p<sign-command>
+  -M<make-command>
   -d             do not check build dependencies and conflicts.
   -D             check build dependencies and conflicts.
   -k<keyid>      the key to use for signing.
@@ -59,6 +60,7 @@
 }
 
 rootcommand=''
+makecommand=''
 signcommand=""
 if [ -e "$GNUPGHOME" ] || [ -e "$HOME/.gnupg" ] && \
 		command -v gpg > /dev/null 2>&1; then
@@ -96,6 +98,7 @@
 		admindir="$value" ;;
 	-r*)	rootcommand="$value" ;;
 	-p*)	signcommand="$value" ;;
+	-M*)	makecommand="$value" ;;
 	-k*)	signkey="$value" ;;
 	-d)	checkbuilddep=false ;;
 	-D)	checkbuilddep=true ;;
@@ -220,14 +223,14 @@
 if [ -n "$desc"		]; then set -- "$@" "-C$desc"		; fi
 
 if [ x$noclean != xtrue ]; then
-	withecho $rootcommand debian/rules clean
+	withecho $rootcommand $makecommand debian/rules clean
 fi
 if [ x$binaryonly = x ]; then
 	cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b "$dirn"; cd "$dirn"
 fi
 if [ x$sourceonly = x ]; then
-	withecho debian/rules build 
-	withecho $rootcommand debian/rules $binarytarget
+	withecho $makecommand debian/rules build 
+	withecho $rootcommand $makecommand debian/rules $binarytarget
 fi
 if [ "$usepause" = "true" ] && \
    ( [ "$signchanges" != ":" ] || ( [ -z "$binaryonly" ] && [ "$signsource" != ":" ] ) ) ; then
@@ -281,7 +284,7 @@
 fi
 
 if $cleansource; then
-	withecho $rootcommand debian/rules clean
+	withecho $rootcommand $makecommand debian/rules clean
 fi
 
 echo "dpkg-buildpackage: $srcmsg"

Reply via email to