Blame SOURCES/0001-Isolate-_smp_build_ncpus-and-use-it-for-_smp_mflags.patch

ed184b
From e811c7ec0b4d2685b63b61803e3952466b1a4ac6 Mon Sep 17 00:00:00 2001
ed184b
Message-Id: <e811c7ec0b4d2685b63b61803e3952466b1a4ac6.1574335619.git.pmatilai@redhat.com>
ed184b
From: marxin <mliska@suse.cz>
ed184b
Date: Wed, 28 Nov 2018 10:52:01 +0100
ed184b
Subject: [PATCH] Isolate %_smp_build_ncpus and use it for %_smp_mflags.
ed184b
ed184b
Refactor _smp_build_ncpus and use it in %_smp_mflags. Note that now
ed184b
having a single CPU, %_smp_mflags is expanded to '-j1'.
ed184b
ed184b
XXX: hand-edited to remove double quotes as per upstream commit
ed184b
     9b6fdc65ef0507fff04a69c88e085a7a26711839 which isn't applicable
ed184b
     directly due to other changes
ed184b
ed184b
---
ed184b
 platform.in | 7 +++++--
ed184b
 1 file changed, 5 insertions(+), 2 deletions(-)
ed184b
ed184b
diff --git a/platform.in b/platform.in
ed184b
index 3eb67b55b..2dd951f87 100644
ed184b
--- a/platform.in
ed184b
+++ b/platform.in
ed184b
@@ -50,11 +50,14 @@
ed184b
 
ed184b
 # Maximum number of CPU's to use when building, 0 for unlimited.
ed184b
 #%_smp_ncpus_max 0
ed184b
-%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
ed184b
+
ed184b
+%_smp_build_ncpus %([ -z "$RPM_BUILD_NCPUS" ] \\\
ed184b
 	&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
ed184b
         ncpus_max=%{?_smp_ncpus_max}; \\\
ed184b
         if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
ed184b
-        if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
ed184b
+        echo "$RPM_BUILD_NCPUS";)
ed184b
+
ed184b
+%_smp_mflags -j%{_smp_build_ncpus}
ed184b
 
ed184b
 #==============================================================================
ed184b
 # ---- Build policy macros.
ed184b
-- 
ed184b
2.23.0
ed184b