Override rpmbuild build location when called from command line
Yes, just override _topdir
directly.
rpmbuild -D '_topdir /new/value/for/_topdir'
or
rpmbuild --define='_topdir /new/value/for/_topdir'
those should be identical but I've learned that they aren't always for some reason (and in quick tests rpm -D '_topdir /opt/tnstmp' --showrc | grep _topdir
doesn't show the modified value but rpm --define '_topdir /opt/tnstmp' --showrc | grep _topdir
did).