.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "RPMBUILD" "8" "09 June 2002" "" ""
.SH NAME
rpmbuild \- Build RPM Package(s)
.SH SYNOPSIS
.SS BUILDING PACKAGES
\f[B]rpmbuild\f[R]
{\f[B]\-ba|\-bb|\-bp|\-bf|\-bc|\-bi|\-bl|\-bs|\-br|\-bd\f[R]}
[\f[B]rpmbuild\-options\f[R]] \f[I]SPECFILE ...\f[R]
.PP
\f[B]rpmbuild\f[R]
{\f[B]\-ra|\-rb|\-rp|\-rf|\-rc|\-ri|\-rl|\-rs|\-rr|\-rd\f[R]}
[\f[B]rpmbuild\-options\f[R]] \f[I]SOURCEPACKAGE ...\f[R]
.PP
\f[B]rpmbuild\f[R]
{\f[B]\-ta|\-tb|\-tp|\-tf|\-tc|\-ti|\-tl|\-ts|\-tr|\-td\f[R]}
[\f[B]rpmbuild\-options\f[R]] \f[I]TARBALL ...\f[R]
.PP
\f[B]rpmbuild\f[R] {\f[B]\-\-rebuild|\-\-recompile\f[R]} \f[I]SOURCEPKG
\&...\f[R]
.SS MISCELLANEOUS
\f[B]rpmbuild\f[R] \f[B]\-\-showrc\f[R]
.SS rpmbuild\-options
[\f[B]\-\-buildroot\f[R] \f[I]DIRECTORY\f[R]] [\f[B]\-\-clean\f[R]]
[\f[B]\-\-nobuild\f[R]] [\f[B]\-\-rmsource\f[R]] [\f[B]\-\-rmspec\f[R]]
[\f[B]\-\-short\-circuit\f[R]] [\f[B]\-\-build\-in\-place\f[R]]
[\f[B]\-\-noprep\f[R]] [\f[B]\-\-noclean\f[R]] [\f[B]\-\-nocheck\f[R]]
[\f[B]\-\-rpmfcdebug\f[R]] [\f[B]\-\-target\f[R] \f[I]PLATFORM\f[R]]
[\f[B]\-\-with\f[R] \f[I]OPTION\f[R]] [\f[B]\-\-without\f[R]
\f[I]OPTION\f[R]]
.SH DESCRIPTION
\f[B]rpmbuild\f[R] is used to build both binary and source software
packages.
A \f[B]package\f[R] 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.
\f[B]Packages\f[R] 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: \f[I]Build
Package\f[R], \f[I]Build Package from Tarball\f[R], \f[I]Recompile
Package\f[R], \f[I]Show Configuration\f[R].
.SS GENERAL OPTIONS
These options can be used in all the different modes.
.TP
\f[B]\-?, \-\-help\f[R]
Print a longer usage message then normal.
.TP
\f[B]\-\-version\f[R]
Print a single line containing the version number of \f[B]rpm\f[R] being
used.
.TP
\f[B]\-\-quiet\f[R]
Print as little as possible \- normally only error messages will be
displayed.
.TP
\f[B]\-v\f[R]
Print verbose information \- normally routine progress messages will be
displayed.
.TP
\f[B]\-vv\f[R]
Print lots of ugly debugging information.
.TP
\f[B]\-\-rpmfcdebug\f[R]
Enables to debug dependencies generation.
.TP
\f[B]\-\-rcfile\f[R] \f[I]FILELIST\f[R]
Replace default list of configuration files to be read with
\f[I]FILELIST\f[R].
See \f[B]rpmrc Configuration\f[R] in \f[B]rpm\f[R](8) for details.
.TP
\f[B]\-\-load\f[R] \f[I]FILE\f[R]
Load an individual macro file.
.TP
\f[B]\-\-macros\f[R] \f[I]FILELIST\f[R]
Replace the list of macro files to be loaded with \f[I]FILELIST\f[R].
See \f[B]Macro Configuration\f[R] in \f[B]rpm\f[R](8) for details.
.TP
\f[B]\-\-pipe\f[R] \f[I]CMD\f[R]
Pipes the output of \f[B]rpm\f[R] to the command \f[I]CMD\f[R].
.TP
\f[B]\-\-dbpath\f[R] \f[I]DIRECTORY\f[R]
Use the database in \f[I]DIRECTORY\f[R] rather than the default path
\f[I]/var/lib/rpm\f[R].
.TP
\f[B]\-\-root\f[R] \f[I]DIRECTORY\f[R]
Use the file system tree rooted at \f[I]DIRECTORY\f[R] for all
operations.
Note that this means the database within \f[I]DIRECTORY\f[R] will be
used for dependency checks and any scriptlet(s) (e.g.\ \f[B]%post\f[R]
if installing, or \f[B]%prep\f[R] if building, a package) will be run
after a chroot(2) to \f[I]DIRECTORY\f[R].
.TP
\f[B]\-D, \-\-define=\[aq]\f[R]\f[I]MACRO EXPR\f[R]\f[B]\[aq]\f[R]
Defines \f[I]MACRO\f[R] with value \f[I]EXPR\f[R].
.TP
\f[B]\-\-scm=\f[R]\f[I]SCM\f[R]
Select the \f[I]SCM\f[R] to use with \f[B]%autosetup\f[R], if one is not
set in the spec file.
Note that not all values for \f[I]SCM\f[R], e.g., \f[B]patch\f[R] (the
default) and \f[B]gendiff\f[R], \f[B]git\f[R], or \f[B]quilt\f[R] work
interchangeably with all other patches and options stated in the
%autosetup line, especially option \f[B]\-p\f[R]\f[I]N\f[R].
.SS BUILD OPTIONS
The general form of an \f[B]rpm\f[R](8) build command is
.PP
\f[B]rpmbuild\f[R]
{\f[B]\-b\f[R]\f[I]STAGE\f[R]\f[B]|\-r\f[R]\f[I]STAGE\f[R]\f[B]|\-t\f[R]\f[I]STAGE\f[R]}
[\f[B]rpmbuild\-options\f[R]] \f[I]FILE ...\f[R]
.PP
The argument used is \f[B]\-b\f[R] if a spec file is being used to build
the package, \f[B]\-r\f[R] if a source package is to be rebuilt and
\f[B]\-t\f[R] if \f[B]rpmbuild\f[R] should look inside of a (possibly
compressed) tar file for the spec file to use.
.PP
Packages are built in a number of stages.
The first six correspond to the following sections in a spec file:
\f[B]%prep\f[R], \f[B]%generate_buildrequires\f[R], \f[B]%build\f[R],
\f[B]%install\f[R], \f[B]%check\f[R] and \f[B]%clean\f[R].
Finally, binary and source packages are created in an assembly stage.
.PP
The \f[I]STAGE\f[R] character specifies the stage to finish with (after
doing all the stages preceding it), and is one of:
.TP
\f[B]\-ba\f[R]
Perform a full build \- executes up to and including the assembly stage.
In most cases, this is the option to choose.
.TP
\f[B]\-bb\f[R]
Build just the binary packages \- executes up to and including the
assembly stage, but without creating the source package.
On success, the build directory is removed (as in \f[B]\-\-clean\f[R]).
.TP
\f[B]\-bp\f[R]
Unpack the sources and apply any patches \- executes the \f[B]%prep\f[R]
stage only.
.TP
\f[B]\-bf\f[R]
Configure the sources \- executes up to and including the %conf stage.
This generally involves the equivalent of a
\[dq]\f[B]./configure\f[R]\[dq].
.TP
\f[B]\-bc\f[R]
Compile the sources \- executes up to and including the \f[B]%build\f[R]
stage.
This generally involves the equivalent of \[dq]\f[B]make\f[R]\[dq].
.TP
\f[B]\-bi\f[R]
Install the binaries into the build root \- executes up to and including
the \f[B]%check\f[R] stage.
This generally involves the equivalent of a \[dq]\f[B]make
install\f[R]\[dq] and \[dq]\f[B]make check\f[R]\[dq].
.TP
\f[B]\-bl\f[R]
Do a \[dq]list check\[dq] \- the \f[B]%files\f[R] section from the spec
file is macro expanded, and checks are made to verify that each file
exists.
.TP
\f[B]\-bs\f[R]
Build just the source package \- skips straight to the assembly stage,
without executing any of the preceding stages or creating binary
packages.
.TP
\f[B]\-br\f[R]
Build just the source package, but also parse and include dynamic build
dependencies \- executes up to and including the
\f[B]%generate_buildrequires\f[R] stage and then skips straight to the
assembly stage, without creating binary packages.
This command can be used to fully resolve dynamic build dependencies.
See the \f[B]DYNAMIC BUILD DEPENDENCIES\f[R] section for details.
.TP
\f[B]\-bd\f[R]
Check dynamic build dependencies and build the .buildreqs.nosrc.rpm
package if any are missing.
Don\[cq]t build anything else.
.PP
The following options may also be used:
.TP
\f[B]\-\-buildroot\f[R] \f[I]DIRECTORY\f[R] (DEPRECATED)
When building a package, override the buildroot of \f[B]rpmbuild\f[R](8)
to \f[I]DIRECTORY\f[R].
This option is deprecated and will be removed in the future, do not
introduce new usages.
.TP
\f[B]\-\-clean\f[R]
Remove the build tree after the packages are made.
.TP
\f[B]\-\-nobuild\f[R]
Do not execute any build stages.
Useful for testing out spec files.
.TP
\f[B]\-\-noprep\f[R]
Do not execute \f[B]%prep\f[R] build stage even if present in spec.
.TP
\f[B]\-\-noclean\f[R]
Do not execute \f[B]%clean\f[R] build stage even if present in spec.
.TP
\f[B]\-\-nocheck\f[R]
Do not execute \f[B]%check\f[R] build stage even if present in spec.
.TP
\f[B]\-\-nodebuginfo\f[R]
Do not generate debuginfo packages.
.TP
\f[B]\-\-nodeps\f[R]
Do not verify build dependencies.
.TP
\f[B]\-\-rmsource\f[R]
Remove the sources after the build (may also be used standalone,
e.g.\ \[dq]\f[B]rpmbuild\f[R] \f[B]\-\-rmsource foo.spec\f[R]\[dq]).
.TP
\f[B]\-\-rmspec\f[R]
Remove the spec file after the build (may also be used standalone,
e.g.\ \[dq]\f[B]rpmbuild\f[R] \f[B]\-\-rmspec foo.spec\f[R]\[dq]).
.TP
\f[B]\-\-short\-circuit\f[R]
Skip straight to specified stage (i.e., skip all stages leading up to
the specified stage).
Only valid with \f[B]\-bc\f[R], \f[B]\-bi\f[R], and \f[B]\-bb\f[R].
Useful for local testing only.
Packages built this way will be marked with an unsatisfiable dependency
to prevent their accidental use.
.TP
\f[B]\-\-build\-in\-place\f[R]
Build from locally checked out sources in the current working directory.
The build tree is set up as if \f[B]%setup\f[R] was used, but
\f[I]%builddir\f[R]/\f[I]%buildsubdir\f[R] points back to the current
working directory.
\f[B]%prep\f[R] is skipped entirely.
.TP
\f[B]\-\-target\f[R] \f[I]PLATFORM\f[R]
When building the package, interpret \f[I]PLATFORM\f[R] as
\f[B]arch\-vendor\-os\f[R] and set the macros \f[B]%_target\f[R],
\f[B]%_target_cpu\f[R], and \f[B]%_target_os\f[R] accordingly.
.TP
\f[B]\-\-with\f[R] \f[I]OPTION\f[R]
Enable configure \f[I]OPTION\f[R] for build.
.TP
\f[B]\-\-without\f[R] \f[I]OPTION\f[R]
Disable configure \f[I]OPTION\f[R] for build.
.SS REBUILD AND RECOMPILE OPTIONS
There are two other ways to invoke building with \f[B]rpm\f[R](8):
.PP
\f[B]rpmbuild\f[R] \f[B]\-\-rebuild|\-\-recompile\f[R] \f[I]SOURCEPKG
\&...\f[R]
.PP
When invoked this way, \f[B]rpmbuild\f[R] installs the named source
package, and does a prep, compile and install.
In addition, \f[B]\-\-rebuild\f[R] builds a new binary package.
When the build has completed, the build directory is removed (as in
\f[B]\-\-clean\f[R]) and the the sources and spec file for the package
are removed.
.PP
These options are now superseded by the \f[B]\-r*\f[R] options which
allow much more fine control over what stages of the build to run.
.SS DYNAMIC BUILD DEPENDENCIES
When the \f[B]%generate_buildrequires\f[R] stage runs and some of the
newly generated BuildRequires are not satisfied, \f[B]rpmbuild\f[R]
creates an intermediate source package ending in
\f[I]buildreqs.nosrc.rpm\f[R], which has the new BuildRequires, and
exits with code 11.
This package can then be used in place of the original source package to
resolve and install the missing build dependencies in the usual way,
such as with \f[B]dnf\-builddep\f[R](8).
.PP
Multiple layers of dynamic build dependencies may exist in a spec file;
the presence of specific BuildRequires on the system may yield new
BuildRequires next time a build is performed with the same source
package.
The easiest way to ensure that all dynamic build dependencies are
satisfied is to run the \f[B]\-br\f[R] option, install the new
dependencies of the \f[I]buildreqs.nosrc.rpm\f[R] package and repeat the
whole procedure until \f[B]rpmbuild\f[R] no longer exits with code 11.
.PP
If the \f[B]\-br\f[R] command is coupled with \f[B]\-\-nodeps\f[R], exit
code 11 is always returned and a \f[I]buildreqs.nosrc.rpm\f[R] package
is always created.
.SS SHOWRC
The command
.PP
\f[B]rpmbuild\f[R] \f[B]\-\-showrc\f[R]
.PP
shows the values \f[B]rpmbuild\f[R] will use for all of the options are
currently set in \f[I]rpmrc\f[R] and \f[I]macros\f[R] configuration
file(s).
.SH FILES
See \f[B]rpm\f[R](8)
.SH SEE ALSO
\f[B]gendiff\f[R](1), \f[B]popt\f[R](3), \f[B]rpm\f[R](8),
\f[B]rpm2cpio\f[R](8), \f[B]rpmkeys\f[R](8), \f[B]rpmspec\f[R](8),
\f[B]rpmsign\f[R](8)
.PP
\f[B]rpmbuild \-\-help\f[R] \- as rpm supports customizing the options
via popt aliases it\[aq]s impossible to guarantee that what\[aq]s
described in the manual matches what\[aq]s available.
.PP
\f[B]http://www.rpm.org/ \f[R]
.SH AUTHORS
.IP
.EX
Marc Ewing
Jeff Johnson
Erik Troan
.EE