commit 82f23c63247282a8231c3dcb47f594348030a8ff
Author: Elan Ruusamäe <[email protected]>
Date:   Sun Apr 7 21:39:52 2013 +0300

    split %_smp_mflags to %__jobs macro, so unprefixed (with -j) value is 
available as well

 rpm-build-macros.spec |  2 +-
 rpm.macros            | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index b035a07..2ccd3ac 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -1,4 +1,4 @@
-%define                rpm_macros_rev  1.656
+%define                rpm_macros_rev  1.657
 %define                find_lang_rev   1.36
 Summary:       PLD Linux RPM build macros
 Summary(pl.UTF-8):     Makra do budowania pakietów RPM dla Linuksa PLD
diff --git a/rpm.macros b/rpm.macros
index 0769b7e..61da454 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -26,18 +26,20 @@
 %__autopoint   autopoint --force
 
 # add parallel build flags: -jN
+# jobs macro is available since 1.657
 #
 # if you want to disable parallel build do:
-# echo '%_smp_mflags %{nil}' >> ~/.rpmmacros
-#
+# echo '%__jobs %{nil}' >> ~/.rpmmacros
+%__jobs                %{expand:%%global __jobs %(_NCPUS=$(/usr/bin/getconf 
_NPROCESSORS_ONLN); [ "$_NCPUS" -gt 2 ] && echo $(($_NCPUS / 2)))}%__jobs
+
+# expands to -jN if %__jobs has a value
+%_smp_mflags   %{expand:%%global _smp_mflags %(jobs=%{__jobs}; echo 
${jobs:+-j$jobs}%%{nil})}%_smp_mflags
+
 %__make                /usr/bin/make %{?_smp_mflags}
 %__scons       /usr/bin/scons %{?_smp_mflags}
 %__waf         /usr/bin/waf %{?_smp_mflags}
 %__cmake       /usr/bin/cmake
 
-%_smp_mflags %(_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN); \\\
-                               [ "$_NCPUS" -gt 2 ] && echo "-j$(($_NCPUS / 
2))")
-
 %__gettextize { \
        if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
                gettextize --copy --force --no-changelog; \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/82f23c63247282a8231c3dcb47f594348030a8ff

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to