]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buildtool:define variable for setting make jobs
authorOwen Synge <osynge@suse.com>
Fri, 15 May 2015 01:01:39 +0000 (03:01 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:17 +0000 (11:24 +0100)
OBS build hosts are memory-limited, limiting the jobs to 6 prevents build errors.
Original work by Thorsten

Signed-off-by: Owen Synge <osynge@suse.com>
(cherry picked from commit ea851029823c335bde2c70f684fc2bb307f5037d)
(cherry picked from commit 351b2b7a418b4dad3271c4eec1830d4f4bf32cdf)

ceph.spec.in

index 3da1768cca6490766cdc82473a419ec69bee6276..6e1ff86de97267b3c76fe1681f331e72dc5d5068 100644 (file)
 %bcond_without tcmalloc
 %bcond_without libs_compat
 
+# suse OBS build hosts are memory-limited
+%if 0%{?jobs} > 6
+  %define jobs 6
+%endif
+
 %if (0%{?el5} || (0%{?rhel_version} >= 500 && 0%{?rhel_version} <= 600))
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
@@ -524,7 +529,14 @@ sed -i -e "s/-lcurses/-lncurses/g" src/ocf/Makefile
 sed -i -e "s/-lcurses/-lncurses/g" src/java/Makefile
 %endif
 
-make -j$(getconf _NPROCESSORS_ONLN)
+# Set default jobs
+MAKE_JOBS=$(getconf _NPROCESSORS_ONLN)
+# suse OBS build hosts are memory-limited
+%if 0%{defined jobs}
+  MAKE_JOBS=0%{?jobs}
+%endif
+make -j${MAKE_JOBS}
+
 
 
 %if 0%{with tests}