To have rpmbuild put its outputted RPM and/or SRPM in the current directory, add the following lines to your ~/.rpmmacros :
You can then run a command like `rpmbuild -ba foo.spec`%_topdir %{lua:print(posix.getcwd())}%_builddir %{_topdir}/builddir%_rpmdir %{_topdir}%_sourcedir %{_topdir}%_specdir %{_topdir}%_srcrpmdir %{_topdir}%_buildroot %{_topdir}/root