Adil
Adil

Reputation: 2538

rpmbuild generates RPM in which subdirectory

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 Difference between "machine hardware" and "hardware platform"

Upvotes: 2

Views: 3765

Answers (3)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798436

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.

Upvotes: 4

gareth_bowles
gareth_bowles

Reputation: 21130

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.

Upvotes: 2

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

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?

Upvotes: 0

Related Questions