From Fedora Project Wiki

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

BuildRoot tag

Note.png
The RPM in Fedora 10 defines a default buildroot so in Fedora 10 and above it is no longer necessary to define a buildroot tag. Fedora < 10 and EPEL 5 or less still need to have the tag.

The BuildRoot value MUST be below %{_tmppath}/ and MUST contain at least %{name}, %{version} and %{release}. It may invoke mktemp since this is guaranteed to exist on every system. From there, packagers are expected to use a sane BuildRoot.

The recommended values for the BuildRoot tag are (in descending order of preference) :

%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%{_tmppath}/%{name}-%{version}-%{release}-root

At one point, the second was a mandatory value, but it is now left to the packager to decide. If unsure, simply pick the first.