How to set the rpmbuild destination folder

redhatrpmrpmbuild

I noticed rpmbuild (-bb and –buildroot options) creates the .rpm in different locations depending of what OS are you using:

  • GNU/Linux Ubuntu <= 9.04: /usr/src/rpm/…
  • GNU/Linux Ubuntu >= 9.10: /home/rpmbuild/…
  • GNU/Linux Fedora: /usr/src/redhat/…

So how can I set manually the destination folder for all OS?

Best Answer

Replying myself, adding:

%define _rpmdir /outputdir

to .spec file.

Related Topic