How to set the rpmbuild destination folder

Htechno picture Htechno · May 6, 2010 · Viewed 12.8k times · Source

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?

Answer

Htechno picture Htechno · May 6, 2010

Replying myself, adding:

%define _rpmdir /outputdir

to .spec file.