Sid Sahay Sid Sahay - 5 months ago 13
Linux Question

Does RPM build always take the files from ~/rpmbuild?

Everywhere I have seen on the internet, the default location for the rpmbuild is a user's home directory,

~/rpmbuild
. What if I wish to build it in another folder location, say,
~/foo/bar/rpmbuild
?

Why is this? What difference would it make if my build location is something else?

EDIT: This means even the
~/rpmmacros
file could be anywhere.

Answer

you can set the %_topdir variable in the .rpmmacros configuration file (in your home directory) like this:

echo "%_topdir ~/foo/bar/rpmbuild" >> ~/.rpmmacros

It wouldn't (shouldn't) really make much difference; since sources are to be copied there by rpmbuild; then they are build and installed and packaged... Since all paths are supposed to be relative the outcome should be the same.

PS: more information on the rpm build area PPS: a long time ago the default build area was in /usr/src/packages ; but then you had permission issues etc.