Sid Sahay Sid Sahay - 1 year ago 44
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,

. What if I wish to build it in another folder location, say,

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

EDIT: This means even the
file could be anywhere.

Answer Source

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.