CauldronDevelopmentLLC / cbang

C! (cbang) is a library for cross-platform C++ development.
GNU Lesser General Public License v2.1
56 stars 39 forks source link

RPM: populate BUILDROOT by default #140

Closed marcosfrm closed 9 months ago

jcoffland commented 9 months ago

What if RPM_BUILD_ROOT isn't set?

marcosfrm commented 9 months ago

It is always set. Guaranteed to be non-empty and different from / since RPM 4.6 (16 years ago!):

https://github.com/rpm-software-management/rpm/commit/6c0651926aedc302816a0b61e1f1a8ef568be539

We can use the %{buildroot} macro too. It is expanded before the shell runs, while $RPM_BUILD_ROOT is an environment variable set by RPM for use in the spawned shell. Personally, I prefer $RPM_BUILD_ROOT.

marcosfrm commented 9 months ago

%{buildroot} and $RPM_BUILD_ROOT evaluate to the same value.

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_using_buildroot_and_optflags_vs_rpm_build_root_and_rpm_opt_flags