Search code examples
linuxrpmrhelrpmbuildbuilding

prevent rpmbuild from reading ~/.rpmmacros


Is there a way to prevent the rpmbuild command from reading the ~/.rpmmacros file? I want to add rpmbuild to a Make target and want to get a consistent build under any user account, regardless of the options somebody might have personally set in the rpmmacros file in his home directory.

How can I do this? Or, is that actually a bad idea?


Solution

  • Solved this now this by setting $HOME to an empty directory while running rpmbuild:

    mkdir $MY_DIST_DIR/dummyhome
    HOME=$MY_DIST_DIR/dummyhome/ rpmbuild ...
    rm -r $MY_DIST_DIR/dummyhome