From 34c5276fa00058dff40f44d7efb56b3e842f7434 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 25 Oct 2021 11:14:01 -0700 Subject: [PATCH] macros.build-constraints provided by redhat-rpm-config Signed-off-by: Troy Dawson --- epel-rpm-macros.spec | 14 -------------- macros.build-constraints | 42 ---------------------------------------- 2 files changed, 56 deletions(-) delete mode 100644 macros.build-constraints diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index f46c4c9..ec5f75e 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -12,11 +12,7 @@ License: GPLv2 URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: macros.zzz-epel-override -Source2: gpgverify -Source3: pythondist.attr Source9: GPL -# misc macros -Source150: macros.build-constraints BuildArch: noarch Requires: redhat-release >= %{version} @@ -42,21 +38,11 @@ install -Dpm 644 %{SOURCE0} \ install -Dpm 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/rpm/macros.zzz-epel-override -install -Dpm 755 %{SOURCE2} \ - %{buildroot}%{_rpmconfigdir}/gpgverify - -# misc macros -install -Dpm 644 %{SOURCE150} \ - %{buildroot}%{_rpmmacrodir}/macros.build-constraints - %files %license GPL %{_rpmmacrodir}/macros.epel-rpm-macros %{_sysconfdir}/rpm/macros.zzz-epel-override -%{_rpmconfigdir}/gpgverify -# misc macros -%{_rpmmacrodir}/macros.build-constraints %changelog diff --git a/macros.build-constraints b/macros.build-constraints deleted file mode 100644 index db99418..0000000 --- a/macros.build-constraints +++ /dev/null @@ -1,42 +0,0 @@ -# Macros to constrain resource use during the build process - -# outputs build flag overrides to be used in conjunction with -# %%make_build, %%cmake_build etc. -# -# if no override is needed, this macro outputs nothing -# -# - m memory limit in MBs per core; default is 1024 -# -# Usage: -# e.g. %make_build %{limit_build -m 2048} -# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -# %make_build %{limit_build -m 40960} -# => /usr/bin/make -O -j16 V=1 VERBOSE=1 -j1 -# -%limit_build(m:) %{lua: - local mem_per_process=rpm.expand("%{-m*}") - if mem_per_process == "" then - mem_per_process = 1024 - else - mem_per_process = tonumber(mem_per_process) - end - local mem_total = 0 - for line in io.lines('/proc/meminfo') do - if line:sub(1, 9) == "MemTotal:" then - local tokens = {} - for token in line:gmatch("%w+") do - tokens[#tokens + 1] = token - end - mem_total = tonumber(tokens[2]) - break - end - end - local max_jobs = mem_total // (mem_per_process * 1024) - if max_jobs < 1 then - max_jobs = 1 - end - cur_max_jobs=tonumber(rpm.expand("%{_smp_build_ncpus}")) - if cur_max_jobs > max_jobs then - print("-j" .. max_jobs) - end -}