also set %_smp_mflags to BUILD_JOBS
authorLudwig Nussel <ludwig.nussel@suse.de>
Mon, 11 Jan 2010 15:58:45 +0000 (16:58 +0100)
committerLudwig Nussel <ludwig.nussel@suse.de>
Mon, 11 Jan 2010 15:58:45 +0000 (16:58 +0100)
build

diff --git a/build b/build
index 9cc49f9..85f0174 100755 (executable)
--- a/build
+++ b/build
@@ -1377,6 +1377,13 @@ for SPECFILE in "${SPECFILES[@]}" ; do
 
 ' >> $BUILD_ROOT/root/.rpmmacros
        fi
+
+       if [ -n "$BUILD_JOBS" ]; then
+               cat >> $BUILD_ROOT/root/.rpmmacros <<-EOF
+               %jobs $BUILD_JOBS
+               %_smp_mflags -j$BUILD_JOBS
+               EOF
+       fi
        test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmmacros $BUILD_ROOT/home/abuild/.rpmmacros
        # extract optflags from configuration
        getoptflags --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH" ${BUILD_DEBUG:+--debug} > $BUILD_ROOT/root/.rpmrc
@@ -1494,10 +1501,6 @@ for SPECFILE in "${SPECFILES[@]}" ; do
        if [ -n "$ABUILD_TARGET_ARCH" ]; then
                rpmbopts[${#rpmbopts[@]}]="--target=$ABUILD_TARGET_ARCH"
        fi
-       if [ -n "$BUILD_JOBS" ]; then
-               rpmbopts[${#rpmbopts[@]}]='--define'
-               rpmbopts[${#rpmbopts[@]}]="jobs $BUILD_JOBS"
-       fi
        if [ -n "$DISTURL" ]; then
                rpmbopts[${#rpmbopts[@]}]='--define'
                rpmbopts[${#rpmbopts[@]}]="disturl $DISTURL"