tags:

views:

183

answers:

4

rpmbuild generates RPM under which directory?

I checked the RPMS directory:-

[root@tom adil]# ls /usr/src/redhat/
BUILD  RPMS  SOURCES  SPECS  SRPMS
[root@tom adil]# ls /usr/src/redhat/RPMS/
athlon  i386  i486  i586  i686  noarch
[root@tom adil]# 

How to decide rpmbuild outputs in which of the above sub-directories? Is it controlled by spec file? What is the default option?

I thought uname -p but its not the case probable uname -i is used.
Linked to my last question http://stackoverflow.com/questions/2565282/difference-between-machine-hardware-and-hardware-platform

A: 

The RPM goes to the RPMS folder and the source RPM to the SRPMS. This is not controlled by the spec file - this is convention. What exactly are you trying to do?

Bozhidar Batsov
Thanks, that i know. As shown above my RPMS directory has 6 sub-directories: athlon i386 i486 i586 i686 noarch So if i build a RPM, default it will generated under which sub-dir?
Adil
+1  A: 

Following on from your last comment, by default the RPM will go into the subdirectory that matches the platform you're building on. You can override this by passing the --target parameter to rpmbuild, but this only applies where valid; for example, you can use --target i386 on an x86_64 system to build a 32-bit RPM, but you can't build a 64-bit RPM on a 32-bit platform.

gareth_bowles
Thanks if i dont specify it will go under which dir? `uname -a` gives output "Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux "
Adil
It will go into either i686 or i386.
gareth_bowles
+1  A: 

The binary package is named according to the %_build_name_fmt macro. By default this macro contains %{ARCH}/ at the beginning, so that is where the binary package is placed.

Ignacio Vazquez-Abrams
Thanks. How this ARCH value is determined? i am interested in that.
Adil
The arch of a package is determined by the value passed after the `--target` argument to `rpmbuild` (e.g., `--target noarch`).
Ignacio Vazquez-Abrams
A: 

I think uname -i is used.

Adil