Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions rust/package/agama.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

# Require at least 1.3GB RAM per each parallel job (the size is in MB)
%global _smp_tasksize_proc 1300

# Redefine the _smp_mflags macro so it takes the amount of RAM into account
#
# Unfortunately SLE16 contains older rpm v4.18 so we need to calculate that manually :-/
# TODO: use this instead when rpm in SLE16 is updated to a newer version (4.19+):
# %%define _smp_mflags "-j%%{getncpus:proc}"
%define _smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
ram_kb="$(awk '/MemTotal/ {print $2}' /proc/meminfo)"; \\\
ncpus_max=$(("$ram_kb"/1024/%_smp_tasksize_proc)); \\\
if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)

Name: agama
# This will be set by osc services, that will run after this.
Version: 0
Expand Down