diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | build.macros.in | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,6 @@ +- add support for limiting parallel builds by defining + %_smp_ncpus_max in spec file for packages needing it + Version 2.6 - 14 October 2014, by Pascal Terjan - support being passed the egg-info directory diff --git a/build.macros.in b/build.macros.in index 94bc858..5d2a6fe 100644 --- a/build.macros.in +++ b/build.macros.in @@ -207,9 +207,12 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} - export CFLAGS="%optflags"; export CXXFLAGS="%optflags"; export RPM_OPT_FLAGS="%optflags" \ %{nil} - +# Maximum number of CPU's to use when building, 0 for unlimited. +%_smp_ncpus_max 0 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + ncpus_max=%{?_smp_ncpus_max}; \\\ + if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\ [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS") %_make_bin make |