Add macros.build-constraints
Keep the misc macros in alphabetical order Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
This commit is contained in:
parent
e0cfcc0fc7
commit
dbb1278523
10
macros.build-constraints
Normal file
10
macros.build-constraints
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Macros to constrain resource use during the build process
|
||||||
|
|
||||||
|
# m: memory limit in MBs per core; default is 1024
|
||||||
|
%limit_build(m:) \
|
||||||
|
_mem_per_process="%{-m:%{-m*}}%{!-m:1024}" \
|
||||||
|
_max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) \
|
||||||
|
_max_jobs="$(($_max_mem / ($_mem_per_process * 1024)))" \
|
||||||
|
_cur_max_jobs="%{_smp_build_ncpus}" \
|
||||||
|
test "${_cur_max_jobs}" -gt "${_max_jobs}" && _cur_max_jobs="${_max_jobs}" && echo "Warning: Reducing build parallelism to -j${_max_jobs} because of memory limits" \
|
||||||
|
%global _smp_build_ncpus "${_cur_max_jobs}"
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Summary: Red Hat specific rpm configuration files
|
Summary: Red Hat specific rpm configuration files
|
||||||
Name: redhat-rpm-config
|
Name: redhat-rpm-config
|
||||||
Version: 192
|
Version: 193
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
# No version specified.
|
# No version specified.
|
||||||
License: GPL+
|
License: GPL+
|
||||||
@ -36,12 +36,13 @@ Source104: macros.ldc-srpm
|
|||||||
Source105: macros.valgrind-srpm
|
Source105: macros.valgrind-srpm
|
||||||
|
|
||||||
# Other misc macros
|
# Other misc macros
|
||||||
Source150: macros.dwz
|
Source150: macros.build-constraints
|
||||||
Source151: macros.kmp
|
Source151: macros.dwz
|
||||||
Source152: macros.vpath
|
Source152: macros.fedora-misc
|
||||||
Source153: macros.forge
|
Source153: macros.forge
|
||||||
Source154: macros.ldconfig
|
Source154: macros.kmp
|
||||||
Source155: macros.fedora-misc
|
Source155: macros.ldconfig
|
||||||
|
Source156: macros.vpath
|
||||||
|
|
||||||
# Build policy scripts
|
# Build policy scripts
|
||||||
# this comes from https://github.com/rpm-software-management/rpm/pull/344
|
# this comes from https://github.com/rpm-software-management/rpm/pull/344
|
||||||
@ -188,11 +189,12 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
|
|||||||
%{rrcdir}/brp-ldconfig
|
%{rrcdir}/brp-ldconfig
|
||||||
%{_fileattrsdir}/*.attr
|
%{_fileattrsdir}/*.attr
|
||||||
%{_rpmconfigdir}/macros.d/macros.*-srpm
|
%{_rpmconfigdir}/macros.d/macros.*-srpm
|
||||||
|
%{_rpmconfigdir}/macros.d/macros.build-constraints
|
||||||
%{_rpmconfigdir}/macros.d/macros.dwz
|
%{_rpmconfigdir}/macros.d/macros.dwz
|
||||||
|
%{_rpmconfigdir}/macros.d/macros.fedora-misc
|
||||||
%{_rpmconfigdir}/macros.d/macros.forge
|
%{_rpmconfigdir}/macros.d/macros.forge
|
||||||
%{_rpmconfigdir}/macros.d/macros.ldconfig
|
%{_rpmconfigdir}/macros.d/macros.ldconfig
|
||||||
%{_rpmconfigdir}/macros.d/macros.vpath
|
%{_rpmconfigdir}/macros.d/macros.vpath
|
||||||
%{_rpmconfigdir}/macros.d/macros.fedora-misc
|
|
||||||
%dir %{_rpmluadir}/fedora
|
%dir %{_rpmluadir}/fedora
|
||||||
%dir %{_rpmluadir}/fedora/srpm
|
%dir %{_rpmluadir}/fedora/srpm
|
||||||
%dir %{_rpmluadir}/fedora/rpm
|
%dir %{_rpmluadir}/fedora/rpm
|
||||||
@ -213,6 +215,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
|
|||||||
%{_rpmconfigdir}/macros.d/macros.kmp
|
%{_rpmconfigdir}/macros.d/macros.kmp
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jul 24 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 193-1
|
||||||
|
- Add macros.build-constraints
|
||||||
|
- Keep the misc macros in alphabetical order
|
||||||
|
|
||||||
* Sat Jul 10 2021 Neal Gompa <ngompa13@gmail.com> - 192-1
|
* Sat Jul 10 2021 Neal Gompa <ngompa13@gmail.com> - 192-1
|
||||||
- Make vpath builddir not include arch-specific info
|
- Make vpath builddir not include arch-specific info
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user