Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

The rpmbuild Command

The rpmbuild command is used to build RPM packages. The syntax for rpmbuild is:

rpmbuild -[b|t] stage [build-options] spec-file ...

Specify -b to build a package directly from a spec file, or -t to open a tarred, gzipped file and use its spec file.

Both forms take the following single-character stage arguments, which specify the stages, or steps, required to build a package. The stages are listed in the order they would be performed:

p

Perform the prep stage, unpacking source files and applying patches.

l

Do a list check, expanding macros in the files section of the spec file and -verifying that each file exists.

c

Perform the prep and build stages; generally equivalent to doing a make.

i

Perform the prep, build, and install stages; generally equivalent to doing a make install.

b

Perform the prep, build, and install stages, then build a binary package.

s

Build a source package.

a

Perform the prep, build, and install stages, then build both binary and source packages.

The difference between the build stage, which is one of the early steps, and building a binary package in b or ais the difference between building a working binary for the software and putting all the pieces together into a final rpm package.

rpmbuild options

The general rpm options described under General options in General options can be used with rpmbuild.

The following additional options can also be used when building an rpm file with rpmbuild:

--buildroot dir

Override the BuildRoot tag with dir when building the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page