rpmbuild is used to build both binary and source software packages.
A package consists of an archive of files and
meta-data used to install and erase the archive files. The meta-data
includes helper scripts, file attributes, and descriptive information
about the package.
Packages come in two varieties: binary packages,
used to encapsulate software to be installed, and source packages,
containing the source code and recipe necessary to produce binary
One of the following basic modes must be selected:
Build Package from Tarball,
These options can be used in all the different modes.
Print a longer usage message then normal.
Print a single line containing the version number of rpm
Print as little as possible - normally only error messages will
Print verbose information - normally routine progress messages will be
Print lots of ugly debugging information.
Each of the files in the colon separated
is read sequentially by rpm for configuration
Only the first file in the list must exist, and tildes will be
expanded to the value of $HOME.
The default FILELIST is
Pipes the output of rpm to the command CMD.
Use the database in DIRECTORY rather
than the default path /var/lib/rpm
Use the file system tree rooted at DIRECTORY for all operations.
Note that this means the database within
will be used for dependency checks and any scriptlet(s) (e.g.
%post if installing, or
%prep if building, a package)
will be run after a chroot(2) to
The argument used is -b if a spec file is being
used to build the package and -t if rpmbuild
should look inside of a (possibly compressed) tar file for
the spec file to use. After the first argument, the next
character (STAGE) specifies the stages
of building and packaging to be done and is one of:
Build binary and source packages (after doing the %prep, %build, and
Build a binary package (after doing the %prep, %build, and %install
Executes the "%prep" stage from the spec file. Normally this
involves unpacking the sources and applying any patches.
Do the "%build" stage from the spec file (after doing the %prep stage).
This generally involves the equivalent of a "make".
Do the "%install" stage from the spec file (after doing the %prep and
%build stages). This generally involves the equivalent of a
Do a "list check". The "%files" section from the spec file is
macro expanded, and checks are made to verify that each file
Build just the source package.
The following options may also be used:
When building a package, override the BuildRoot tag with directory
Remove the build tree after the packages are made.
Do not execute any build stages. Useful for testing out spec files.
Do not verify build dependencies.
Remove the sources after the build (may also be
used standalone, e.g. "rpmbuild--rmsource foo.spec").
Remove the spec file after the build (may also be
used standalone, eg. "rpmbuild--rmspec foo.spec").
Skip straight to specified stage (i.e., skip all stages leading
up to the specified stage). Only valid with -bc
Embed a GPG signature in the package. This signature can be used
to verify the integrity and the origin of the package. See the
section on GPG SIGNATURES in
for configuration details.
When building the package, interpret PLATFORM
as arch-vendor-os and set the macros
REBUILD AND RECOMPILE OPTIONS
There are two other ways to invoke building with rpm:
When invoked this way, rpmbuild installs the named source
package, and does a prep, compile and install. In addition,
--rebuild builds a new binary package. When the build
has completed, the build directory is removed (as in
--clean) and the the sources and spec file for
the package are removed.
shows the values rpmbuild will use for all of the
options are currently set in