Issue
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.
Solution
You can build rpms without having to modify or maintain a .rpmmacros file by specifying _topdir in the rpmbuild command line. For example,
rpmbuild --define '_topdir $(RPMBUILD_DIR)' \
--define 'version $(VERSION)' \
--define 'release $(RELEASE)' \
-bb $(PKGNAME).spec
is in one of my Makefiles for an rpm project to build my rpms under ${RPMBUILD_DIR} with the specified version and release numbers from variables. I use this a lot so that I can have multiple rpm-building projects that don't conflict with each other trying to build in the same directory.
Answered By - Shadowfen Answer Checked By - David Goodson (WPSolving Volunteer)