There’s two ways to change the default rpmbuild topdir:
-
Per-User: By configuring the RPM topdir in $HOME/.rpmmacros
%_topdir %{getenv:HOME}/rpmbuild
-
Per-Project: By configuring the RPM topdir in the Makefile or on the command line
rpmbuild --define '_topdir build' -ba package.spec
Note: in both cases, you will need to make sure your topdir directory has the appropriate directories (BUILD, SRPM, RPM, SPECS and SOURCES)