.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "RPMBUILD" "8" "09 June 2002" "Red Hat, Inc."
.SH NAME
rpmbuild \- Build RPM Package(s)
.SH SYNOPSIS
.SS "BUILDING PACKAGES:"
.PP
\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR
\fBrpmbuild\fR {\fB-ra|-rb|-rp|-rc|-ri|-rl|-rs\fR} [\fBrpmbuild-options\fR] \fB\fISOURCEPACKAGE\fB\fR\fI ...\fR
\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR
\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR
.SS "MISCELLANEOUS:"
.PP
\fBrpmbuild\fR \fB--showrc\fR
.SS "rpmbuild-options"
.PP
[\fB--buildroot \fIDIRECTORY\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR]
[\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR] [\fB--build-in-place\fR]
[\fB--noprep\fR] [\fB--noclean\fR] [\fB--nocheck\fR]
[\fB--rpmfcdebug\fR]
[\fB--target \fIPLATFORM\fB\fR]
[\fB--with \fIOPTION\fB\fR] [\fB--without \fIOPTION\fB\fR]
.SH "DESCRIPTION"
.PP
\fBrpmbuild\fR is used to build both binary and source software packages.
A \fBpackage\fR 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.
\fBPackages\fR 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
packages.
.PP
One of the following basic modes must be selected:
\fBBuild Package\fR,
\fBBuild Package from Tarball\fR,
\fBRecompile Package\fR,
\fBShow Configuration\fR.
.SS "GENERAL OPTIONS"
.PP
These options can be used in all the different modes.
.TP
\fB-?, --help\fR
Print a longer usage message then normal.
.TP
\fB--version\fR
Print a single line containing the version number of \fBrpm\fR
being used.
.TP
\fB--quiet\fR
Print as little as possible - normally only error messages will
be displayed.
.TP
\fB-v\fR
Print verbose information - normally routine progress messages will be
displayed.
.TP
\fB-vv\fR
Print lots of ugly debugging information.
.TP
\fB--rpmfcdebug\fR
Enables to debug dependencies generation.
.TP
\fB--rcfile \fIFILELIST\fB\fR
Each of the files in the colon separated
\fIFILELIST\fR
is read sequentially by \fBrpm\fR for configuration
information.
Only the first file in the list must exist, and tildes will be
expanded to the value of \fB$HOME\fR.
The default \fIFILELIST\fR is
\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR.
.TP
\fB--pipe \fICMD\fB\fR
Pipes the output of \fBrpm\fR to the command \fICMD\fR.
.TP
\fB--dbpath \fIDIRECTORY\fB\fR
Use the database in \fIDIRECTORY\fR rather
than the default path \fI/var/lib/rpm\fR
.TP
\fB--root \fIDIRECTORY\fB\fR
Use the file system tree rooted at \fIDIRECTORY\fR for all operations.
Note that this means the database within
\fIDIRECTORY\fR
will be used for dependency checks and any scriptlet(s) (e.g.
\fB%post\fR if installing, or
\fB%prep\fR if building, a package)
will be run after a chroot(2) to
\fIDIRECTORY\fR.
.TP
\fB-D, --define='\fIMACRO EXPR\fB'\fR
Defines \fIMACRO\fR with value \fIEXPR\fR.
.SS "BUILD OPTIONS"
.PP
The general form of an rpm build command is
.PP
\fBrpmbuild\fR \fB-b\fISTAGE\fB|-r\fISTAGE\fB|-t\fISTAGE\fB\fR [ \fB rpmbuild-options
\fR ] \fB\fIFILE\fB\fR\fI ...\fR
.PP
The argument used is \fB-b\fR if a spec file is being
used to build the package, \fB-r\fR if a source package is to be rebuild
and \fB-t\fR if \fBrpmbuild\fR
should look inside of a (possibly compressed) tar file for
the spec file to use. After the first argument, the next
character (\fISTAGE\fR) specifies the stages
of building and packaging to be done and is one of:
.TP
\fB-ba\fR
Build binary and source packages (after doing the %prep, %build, and
%install stages).
.TP
\fB-bb\fR
Build a binary package (after doing the %prep, %build, and %install
stages).
.TP
\fB-bp\fR
Executes the "%prep" stage from the spec file. Normally this
involves unpacking the sources and applying any patches.
.TP
\fB-bc\fR
Do the "%build" stage from the spec file (after doing the %prep stage).
This generally involves the equivalent of a "make".
.TP
\fB-bi\fR
Do the "%install" stage from the spec file (after doing the %prep and
%build stages). This generally involves the equivalent of a
"make install".
.TP
\fB-bl\fR
Do a "list check". The "%files" section from the spec file is
macro expanded, and checks are made to verify that each file
exists.
.TP
\fB-bs\fR
Build just the source package.
.PP
The following options may also be used:
.TP
\fB--buildroot \fIDIRECTORY\fB\fR
When building a package, override the BuildRoot tag with directory
\fIDIRECTORY\fR.
.TP
\fB--clean\fR
Remove the build tree after the packages are made.
.TP
\fB--nobuild\fR
Do not execute any build stages. Useful for testing out spec files.
.TP
\fB--noprep\fR
Do not execute %prep build stage even if present in spec.
.TP
\fB--noclean\fR
Do not execute %clean build stage even if present in spec.
.TP
\fB--nocheck\fR
Do not execute %check build stage even if present in spec.
.TP
\fB--nodeps\fR
Do not verify build dependencies.
.TP
\fB--rmsource\fR
Remove the sources after the build (may also be
used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR").
.TP
\fB--rmspec\fR
Remove the spec file after the build (may also be
used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR").
.TP
\fB--short-circuit\fR
Skip straight to specified stage (i.e., skip all stages leading
up to the specified stage). Only valid with \fB-bc\fR, \fB-bi\fR,
and \fB-bb\fR. Useful for local testing only. Packages built this
way will be marked with an unsatisfiable dependency to prevent
their accidental use.
.TP
\fB--build-in-place\fR
Build from locally checked out sources. Sets _builddir to current working
directory. Skips handling of -n and untar in the %setup and the deletion of
the buildSubdir.
.TP
\fB--target \fIPLATFORM\fB\fR
When building the package, interpret \fIPLATFORM\fR
as \fBarch-vendor-os\fR and set the macros
\fB%_target\fR,
\fB%_target_cpu\fR, and
\fB%_target_os\fR
accordingly.
.TP
\fB--with \fIOPTION\fB\fR
Enable configure \fIOPTION\fR for build.
.TP
\fB--without \fIOPTION\fB\fR
Disable configure \fIOPTION\fR for build.
.SS "REBUILD AND RECOMPILE OPTIONS"
.PP
There are two other ways to invoke building with rpm:
.PP
\fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR
.PP
When invoked this way, \fBrpmbuild\fR installs the named source
package, and does a prep, compile and install. In addition,
\fB--rebuild\fR builds a new binary package. When the build
has completed, the build directory is removed (as in
\fB--clean\fR) and the the sources and spec file for
the package are removed.
These options are noaways superseded by the \fB-r*\fR options which allow more more fine control over what stages of the build to run.
.SS "SHOWRC"
.PP
The command
.PP
\fBrpmbuild\fR \fB--showrc\fR
.PP
shows the values \fBrpmbuild\fR will use for all of the
options are currently set in
\fIrpmrc\fR and
\fImacros\fR
configuration file(s).
.SH "FILES"
.SS "rpmrc Configuration"
.PP
.nf
\fI/usr/lib/rpm/rpmrc\fR
\fI/usr/lib/rpm/redhat/rpmrc\fR
\fI/etc/rpmrc\fR
\fI~/.rpmrc\fR
.fi
.SS "Macro Configuration"
.PP
.nf
\fI/usr/lib/rpm/macros\fR
\fI/usr/lib/rpm/redhat/macros\fR
\fI/etc/rpm/macros\fR
\fI~/.rpmmacros\fR
.fi
.SS "Temporary"
.PP
\fI/var/tmp/rpm*\fR
.SH "SEE ALSO"
.nf
\fBgendiff\fR(1),
\fBpopt\fR(3),
\fBrpm\fR(8),
\fBrpm2cpio\fR(8),
\fBrpmkeys\fR(8)
\fBrpmspec\fR(8),
\fBrpmsign\fR(8),
.fi
\fBrpmbuild --help\fR - as rpm supports customizing the options via popt
aliases it's impossible to guarantee that what's described in the manual
matches what's available.
\fBhttp://www.rpm.org/
\fR
.SH "AUTHORS"
.nf
Marc Ewing
Jeff Johnson
Erik Troan
.fi