Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how $RPM_BUILD_ROOT relates to BuildRoot. It's clear that BuildRoot is the temporary path used during RPM construction. But here for example, they say buildroot is used during actual installation?

" RPM_BUILD_ROOT — This environment variable is used to hold the "build root", into which the newly built software will be installed. If no explicit build root has been specified (either by command line option, spec file tag line, or rpmrc file entry), this variable will be null. "

So, does buildroot has any effect during actual installation? Or it's only needed for RPM building, and user always specifies the target path via --prefix?

Also, during files and postun sections, any sense to use the buildroot? If not, what is the correct way to specify files and directories, taking into account the prefix set by user?


share|improve this question
up vote 1 down vote accepted

No the buildroot is only used during the building of the RPM

share|improve this answer
Thanks for clarification. And what about the files and postun section - how I can reference the destination directory set by the user? – SyRenity Dec 17 '10 at 4:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.