I noticed rpmbuild (-bb and --buildroot options) creates the .rpm in different locations depending of what OS are you using:
You may want to use the command argument --define
: For example, this will send the rpm files into the current directory.
rpmbuild anything.spec --bb --define "_rpmdir $(pwd)"
This will send the rpmsto output dir
rpmbuild anything.spec --bb --define "_rpmdir /outputdir"
Or perhaps something more complicated such as Custom gradle task for rpmbuild .