packaging(RHEL-CTDB): enable parallel build
authorMichael Adam <obnox@samba.org>
Thu, 20 Aug 2009 11:37:11 +0000 (13:37 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 13 Nov 2009 15:19:40 +0000 (16:19 +0100)
Michael

packaging/RHEL-CTDB/samba.spec.tmpl

index 88cfe01e19b13541f129b19b96c9e7d879f37c15..48b2c5c4b9b8d5d9506c89e85048a8ac02a0ac06 100644 (file)
@@ -43,6 +43,7 @@ BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-deve
 
 %define _libarchdir /usr/%{_libarch}
 
+%define numcpu  %(grep "^processor" /proc/cpuinfo |wc -l | sed -e 's/^0$/1/')
 
 %description
 Samba is the protocol by which a lot of PC-related machines share
@@ -200,7 +201,7 @@ if [ ${CC_MAJOR} -ge 3 ]; then
         fi
 fi
 
-make %{?_smp_mflags} \
+make -j%{numcpu} %{?_smp_mflags} \
        nss_modules pam_modules
 
 rm -rf %{_32bit_tmp_dir}
@@ -266,7 +267,7 @@ if [ ${CC_MAJOR} -ge 3 ]; then
 fi
 
 
-make %{?_smp_mflags} \
+make -j %{numcpu} %{?_smp_mflags} \
        all modules pam_smbpass
 
 # Remove some permission bits to avoid to many dependencies