| 1 |
.\" Automatically generated by Pandoc 3.1.11.1 |
| 2 |
.\" |
| 3 |
.TH "RPMBUILD" "8" "09 June 2002" "" "" |
| 4 |
.SH NAME |
| 5 |
rpmbuild \- Build RPM Package(s) |
| 6 |
.SH SYNOPSIS |
| 7 |
.SS BUILDING PACKAGES |
| 8 |
\f[B]rpmbuild\f[R] |
| 9 |
{\f[B]\-ba|\-bb|\-bp|\-bf|\-bc|\-bi|\-bl|\-bs|\-br|\-bd\f[R]} |
| 10 |
[\f[B]rpmbuild\-options\f[R]] \f[I]SPECFILE ...\f[R] |
| 11 |
.PP |
| 12 |
\f[B]rpmbuild\f[R] |
| 13 |
{\f[B]\-ra|\-rb|\-rp|\-rf|\-rc|\-ri|\-rl|\-rs|\-rr|\-rd\f[R]} |
| 14 |
[\f[B]rpmbuild\-options\f[R]] \f[I]SOURCEPACKAGE ...\f[R] |
| 15 |
.PP |
| 16 |
\f[B]rpmbuild\f[R] |
| 17 |
{\f[B]\-ta|\-tb|\-tp|\-tf|\-tc|\-ti|\-tl|\-ts|\-tr|\-td\f[R]} |
| 18 |
[\f[B]rpmbuild\-options\f[R]] \f[I]TARBALL ...\f[R] |
| 19 |
.PP |
| 20 |
\f[B]rpmbuild\f[R] {\f[B]\-\-rebuild|\-\-recompile\f[R]} \f[I]SOURCEPKG |
| 21 |
\&...\f[R] |
| 22 |
.SS MISCELLANEOUS |
| 23 |
\f[B]rpmbuild\f[R] \f[B]\-\-showrc\f[R] |
| 24 |
.SS rpmbuild\-options |
| 25 |
[\f[B]\-\-buildroot\f[R] \f[I]DIRECTORY\f[R]] [\f[B]\-\-clean\f[R]] |
| 26 |
[\f[B]\-\-nobuild\f[R]] [\f[B]\-\-rmsource\f[R]] [\f[B]\-\-rmspec\f[R]] |
| 27 |
[\f[B]\-\-short\-circuit\f[R]] [\f[B]\-\-build\-in\-place\f[R]] |
| 28 |
[\f[B]\-\-noprep\f[R]] [\f[B]\-\-noclean\f[R]] [\f[B]\-\-nocheck\f[R]] |
| 29 |
[\f[B]\-\-rpmfcdebug\f[R]] [\f[B]\-\-target\f[R] \f[I]PLATFORM\f[R]] |
| 30 |
[\f[B]\-\-with\f[R] \f[I]OPTION\f[R]] [\f[B]\-\-without\f[R] |
| 31 |
\f[I]OPTION\f[R]] |
| 32 |
.SH DESCRIPTION |
| 33 |
\f[B]rpmbuild\f[R] is used to build both binary and source software |
| 34 |
packages. |
| 35 |
A \f[B]package\f[R] consists of an archive of files and meta\-data used |
| 36 |
to install and erase the archive files. |
| 37 |
The meta\-data includes helper scripts, file attributes, and descriptive |
| 38 |
information about the package. |
| 39 |
\f[B]Packages\f[R] come in two varieties: binary packages, used to |
| 40 |
encapsulate software to be installed, and source packages, containing |
| 41 |
the source code and recipe necessary to produce binary packages. |
| 42 |
.PP |
| 43 |
One of the following basic modes must be selected: \f[I]Build |
| 44 |
Package\f[R], \f[I]Build Package from Tarball\f[R], \f[I]Recompile |
| 45 |
Package\f[R], \f[I]Show Configuration\f[R]. |
| 46 |
.SS GENERAL OPTIONS |
| 47 |
These options can be used in all the different modes. |
| 48 |
.TP |
| 49 |
\f[B]\-?, \-\-help\f[R] |
| 50 |
Print a longer usage message then normal. |
| 51 |
.TP |
| 52 |
\f[B]\-\-version\f[R] |
| 53 |
Print a single line containing the version number of \f[B]rpm\f[R] being |
| 54 |
used. |
| 55 |
.TP |
| 56 |
\f[B]\-\-quiet\f[R] |
| 57 |
Print as little as possible \- normally only error messages will be |
| 58 |
displayed. |
| 59 |
.TP |
| 60 |
\f[B]\-v\f[R] |
| 61 |
Print verbose information \- normally routine progress messages will be |
| 62 |
displayed. |
| 63 |
.TP |
| 64 |
\f[B]\-vv\f[R] |
| 65 |
Print lots of ugly debugging information. |
| 66 |
.TP |
| 67 |
\f[B]\-\-rpmfcdebug\f[R] |
| 68 |
Enables to debug dependencies generation. |
| 69 |
.TP |
| 70 |
\f[B]\-\-rcfile\f[R] \f[I]FILELIST\f[R] |
| 71 |
Replace default list of configuration files to be read with |
| 72 |
\f[I]FILELIST\f[R]. |
| 73 |
See \f[B]rpmrc Configuration\f[R] in \f[B]rpm\f[R](8) for details. |
| 74 |
.TP |
| 75 |
\f[B]\-\-load\f[R] \f[I]FILE\f[R] |
| 76 |
Load an individual macro file. |
| 77 |
.TP |
| 78 |
\f[B]\-\-macros\f[R] \f[I]FILELIST\f[R] |
| 79 |
Replace the list of macro files to be loaded with \f[I]FILELIST\f[R]. |
| 80 |
See \f[B]Macro Configuration\f[R] in \f[B]rpm\f[R](8) for details. |
| 81 |
.TP |
| 82 |
\f[B]\-\-pipe\f[R] \f[I]CMD\f[R] |
| 83 |
Pipes the output of \f[B]rpm\f[R] to the command \f[I]CMD\f[R]. |
| 84 |
.TP |
| 85 |
\f[B]\-\-dbpath\f[R] \f[I]DIRECTORY\f[R] |
| 86 |
Use the database in \f[I]DIRECTORY\f[R] rather than the default path |
| 87 |
\f[I]/var/lib/rpm\f[R]. |
| 88 |
.TP |
| 89 |
\f[B]\-\-root\f[R] \f[I]DIRECTORY\f[R] |
| 90 |
Use the file system tree rooted at \f[I]DIRECTORY\f[R] for all |
| 91 |
operations. |
| 92 |
Note that this means the database within \f[I]DIRECTORY\f[R] will be |
| 93 |
used for dependency checks and any scriptlet(s) (e.g.\ \f[B]%post\f[R] |
| 94 |
if installing, or \f[B]%prep\f[R] if building, a package) will be run |
| 95 |
after a chroot(2) to \f[I]DIRECTORY\f[R]. |
| 96 |
.TP |
| 97 |
\f[B]\-D, \-\-define=\[aq]\f[R]\f[I]MACRO EXPR\f[R]\f[B]\[aq]\f[R] |
| 98 |
Defines \f[I]MACRO\f[R] with value \f[I]EXPR\f[R]. |
| 99 |
.TP |
| 100 |
\f[B]\-\-scm=\f[R]\f[I]SCM\f[R] |
| 101 |
Select the \f[I]SCM\f[R] to use with \f[B]%autosetup\f[R], if one is not |
| 102 |
set in the spec file. |
| 103 |
Note that not all values for \f[I]SCM\f[R], e.g., \f[B]patch\f[R] (the |
| 104 |
default) and \f[B]gendiff\f[R], \f[B]git\f[R], or \f[B]quilt\f[R] work |
| 105 |
interchangeably with all other patches and options stated in the |
| 106 |
%autosetup line, especially option \f[B]\-p\f[R]\f[I]N\f[R]. |
| 107 |
.SS BUILD OPTIONS |
| 108 |
The general form of an \f[B]rpm\f[R](8) build command is |
| 109 |
.PP |
| 110 |
\f[B]rpmbuild\f[R] |
| 111 |
{\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]} |
| 112 |
[\f[B]rpmbuild\-options\f[R]] \f[I]FILE ...\f[R] |
| 113 |
.PP |
| 114 |
The argument used is \f[B]\-b\f[R] if a spec file is being used to build |
| 115 |
the package, \f[B]\-r\f[R] if a source package is to be rebuilt and |
| 116 |
\f[B]\-t\f[R] if \f[B]rpmbuild\f[R] should look inside of a (possibly |
| 117 |
compressed) tar file for the spec file to use. |
| 118 |
.PP |
| 119 |
Packages are built in a number of stages. |
| 120 |
The first six correspond to the following sections in a spec file: |
| 121 |
\f[B]%prep\f[R], \f[B]%generate_buildrequires\f[R], \f[B]%build\f[R], |
| 122 |
\f[B]%install\f[R], \f[B]%check\f[R] and \f[B]%clean\f[R]. |
| 123 |
Finally, binary and source packages are created in an assembly stage. |
| 124 |
.PP |
| 125 |
The \f[I]STAGE\f[R] character specifies the stage to finish with (after |
| 126 |
doing all the stages preceding it), and is one of: |
| 127 |
.TP |
| 128 |
\f[B]\-ba\f[R] |
| 129 |
Perform a full build \- executes up to and including the assembly stage. |
| 130 |
In most cases, this is the option to choose. |
| 131 |
.TP |
| 132 |
\f[B]\-bb\f[R] |
| 133 |
Build just the binary packages \- executes up to and including the |
| 134 |
assembly stage, but without creating the source package. |
| 135 |
On success, the build directory is removed (as in \f[B]\-\-clean\f[R]). |
| 136 |
.TP |
| 137 |
\f[B]\-bp\f[R] |
| 138 |
Unpack the sources and apply any patches \- executes the \f[B]%prep\f[R] |
| 139 |
stage only. |
| 140 |
.TP |
| 141 |
\f[B]\-bf\f[R] |
| 142 |
Configure the sources \- executes up to and including the %conf stage. |
| 143 |
This generally involves the equivalent of a |
| 144 |
\[dq]\f[B]./configure\f[R]\[dq]. |
| 145 |
.TP |
| 146 |
\f[B]\-bc\f[R] |
| 147 |
Compile the sources \- executes up to and including the \f[B]%build\f[R] |
| 148 |
stage. |
| 149 |
This generally involves the equivalent of \[dq]\f[B]make\f[R]\[dq]. |
| 150 |
.TP |
| 151 |
\f[B]\-bi\f[R] |
| 152 |
Install the binaries into the build root \- executes up to and including |
| 153 |
the \f[B]%check\f[R] stage. |
| 154 |
This generally involves the equivalent of a \[dq]\f[B]make |
| 155 |
install\f[R]\[dq] and \[dq]\f[B]make check\f[R]\[dq]. |
| 156 |
.TP |
| 157 |
\f[B]\-bl\f[R] |
| 158 |
Do a \[dq]list check\[dq] \- the \f[B]%files\f[R] section from the spec |
| 159 |
file is macro expanded, and checks are made to verify that each file |
| 160 |
exists. |
| 161 |
.TP |
| 162 |
\f[B]\-bs\f[R] |
| 163 |
Build just the source package \- skips straight to the assembly stage, |
| 164 |
without executing any of the preceding stages or creating binary |
| 165 |
packages. |
| 166 |
.TP |
| 167 |
\f[B]\-br\f[R] |
| 168 |
Build just the source package, but also parse and include dynamic build |
| 169 |
dependencies \- executes up to and including the |
| 170 |
\f[B]%generate_buildrequires\f[R] stage and then skips straight to the |
| 171 |
assembly stage, without creating binary packages. |
| 172 |
This command can be used to fully resolve dynamic build dependencies. |
| 173 |
See the \f[B]DYNAMIC BUILD DEPENDENCIES\f[R] section for details. |
| 174 |
.TP |
| 175 |
\f[B]\-bd\f[R] |
| 176 |
Check dynamic build dependencies and build the .buildreqs.nosrc.rpm |
| 177 |
package if any are missing. |
| 178 |
Don\[cq]t build anything else. |
| 179 |
.PP |
| 180 |
The following options may also be used: |
| 181 |
.TP |
| 182 |
\f[B]\-\-buildroot\f[R] \f[I]DIRECTORY\f[R] (DEPRECATED) |
| 183 |
When building a package, override the buildroot of \f[B]rpmbuild\f[R](8) |
| 184 |
to \f[I]DIRECTORY\f[R]. |
| 185 |
This option is deprecated and will be removed in the future, do not |
| 186 |
introduce new usages. |
| 187 |
.TP |
| 188 |
\f[B]\-\-clean\f[R] |
| 189 |
Remove the build tree after the packages are made. |
| 190 |
.TP |
| 191 |
\f[B]\-\-nobuild\f[R] |
| 192 |
Do not execute any build stages. |
| 193 |
Useful for testing out spec files. |
| 194 |
.TP |
| 195 |
\f[B]\-\-noprep\f[R] |
| 196 |
Do not execute \f[B]%prep\f[R] build stage even if present in spec. |
| 197 |
.TP |
| 198 |
\f[B]\-\-noclean\f[R] |
| 199 |
Do not execute \f[B]%clean\f[R] build stage even if present in spec. |
| 200 |
.TP |
| 201 |
\f[B]\-\-nocheck\f[R] |
| 202 |
Do not execute \f[B]%check\f[R] build stage even if present in spec. |
| 203 |
.TP |
| 204 |
\f[B]\-\-nodebuginfo\f[R] |
| 205 |
Do not generate debuginfo packages. |
| 206 |
.TP |
| 207 |
\f[B]\-\-nodeps\f[R] |
| 208 |
Do not verify build dependencies. |
| 209 |
.TP |
| 210 |
\f[B]\-\-rmsource\f[R] |
| 211 |
Remove the sources after the build (may also be used standalone, |
| 212 |
e.g.\ \[dq]\f[B]rpmbuild\f[R] \f[B]\-\-rmsource foo.spec\f[R]\[dq]). |
| 213 |
.TP |
| 214 |
\f[B]\-\-rmspec\f[R] |
| 215 |
Remove the spec file after the build (may also be used standalone, |
| 216 |
e.g.\ \[dq]\f[B]rpmbuild\f[R] \f[B]\-\-rmspec foo.spec\f[R]\[dq]). |
| 217 |
.TP |
| 218 |
\f[B]\-\-short\-circuit\f[R] |
| 219 |
Skip straight to specified stage (i.e., skip all stages leading up to |
| 220 |
the specified stage). |
| 221 |
Only valid with \f[B]\-bc\f[R], \f[B]\-bi\f[R], and \f[B]\-bb\f[R]. |
| 222 |
Useful for local testing only. |
| 223 |
Packages built this way will be marked with an unsatisfiable dependency |
| 224 |
to prevent their accidental use. |
| 225 |
.TP |
| 226 |
\f[B]\-\-build\-in\-place\f[R] |
| 227 |
Build from locally checked out sources in the current working directory. |
| 228 |
The build tree is set up as if \f[B]%setup\f[R] was used, but |
| 229 |
\f[I]%builddir\f[R]/\f[I]%buildsubdir\f[R] points back to the current |
| 230 |
working directory. |
| 231 |
\f[B]%prep\f[R] is skipped entirely. |
| 232 |
.TP |
| 233 |
\f[B]\-\-target\f[R] \f[I]PLATFORM\f[R] |
| 234 |
When building the package, interpret \f[I]PLATFORM\f[R] as |
| 235 |
\f[B]arch\-vendor\-os\f[R] and set the macros \f[B]%_target\f[R], |
| 236 |
\f[B]%_target_cpu\f[R], and \f[B]%_target_os\f[R] accordingly. |
| 237 |
.TP |
| 238 |
\f[B]\-\-with\f[R] \f[I]OPTION\f[R] |
| 239 |
Enable configure \f[I]OPTION\f[R] for build. |
| 240 |
.TP |
| 241 |
\f[B]\-\-without\f[R] \f[I]OPTION\f[R] |
| 242 |
Disable configure \f[I]OPTION\f[R] for build. |
| 243 |
.SS REBUILD AND RECOMPILE OPTIONS |
| 244 |
There are two other ways to invoke building with \f[B]rpm\f[R](8): |
| 245 |
.PP |
| 246 |
\f[B]rpmbuild\f[R] \f[B]\-\-rebuild|\-\-recompile\f[R] \f[I]SOURCEPKG |
| 247 |
\&...\f[R] |
| 248 |
.PP |
| 249 |
When invoked this way, \f[B]rpmbuild\f[R] installs the named source |
| 250 |
package, and does a prep, compile and install. |
| 251 |
In addition, \f[B]\-\-rebuild\f[R] builds a new binary package. |
| 252 |
When the build has completed, the build directory is removed (as in |
| 253 |
\f[B]\-\-clean\f[R]) and the the sources and spec file for the package |
| 254 |
are removed. |
| 255 |
.PP |
| 256 |
These options are now superseded by the \f[B]\-r*\f[R] options which |
| 257 |
allow much more fine control over what stages of the build to run. |
| 258 |
.SS DYNAMIC BUILD DEPENDENCIES |
| 259 |
When the \f[B]%generate_buildrequires\f[R] stage runs and some of the |
| 260 |
newly generated BuildRequires are not satisfied, \f[B]rpmbuild\f[R] |
| 261 |
creates an intermediate source package ending in |
| 262 |
\f[I]buildreqs.nosrc.rpm\f[R], which has the new BuildRequires, and |
| 263 |
exits with code 11. |
| 264 |
This package can then be used in place of the original source package to |
| 265 |
resolve and install the missing build dependencies in the usual way, |
| 266 |
such as with \f[B]dnf\-builddep\f[R](8). |
| 267 |
.PP |
| 268 |
Multiple layers of dynamic build dependencies may exist in a spec file; |
| 269 |
the presence of specific BuildRequires on the system may yield new |
| 270 |
BuildRequires next time a build is performed with the same source |
| 271 |
package. |
| 272 |
The easiest way to ensure that all dynamic build dependencies are |
| 273 |
satisfied is to run the \f[B]\-br\f[R] option, install the new |
| 274 |
dependencies of the \f[I]buildreqs.nosrc.rpm\f[R] package and repeat the |
| 275 |
whole procedure until \f[B]rpmbuild\f[R] no longer exits with code 11. |
| 276 |
.PP |
| 277 |
If the \f[B]\-br\f[R] command is coupled with \f[B]\-\-nodeps\f[R], exit |
| 278 |
code 11 is always returned and a \f[I]buildreqs.nosrc.rpm\f[R] package |
| 279 |
is always created. |
| 280 |
.SS SHOWRC |
| 281 |
The command |
| 282 |
.PP |
| 283 |
\f[B]rpmbuild\f[R] \f[B]\-\-showrc\f[R] |
| 284 |
.PP |
| 285 |
shows the values \f[B]rpmbuild\f[R] will use for all of the options are |
| 286 |
currently set in \f[I]rpmrc\f[R] and \f[I]macros\f[R] configuration |
| 287 |
file(s). |
| 288 |
.SH FILES |
| 289 |
See \f[B]rpm\f[R](8) |
| 290 |
.SH SEE ALSO |
| 291 |
\f[B]gendiff\f[R](1), \f[B]popt\f[R](3), \f[B]rpm\f[R](8), |
| 292 |
\f[B]rpm2cpio\f[R](8), \f[B]rpmkeys\f[R](8), \f[B]rpmspec\f[R](8), |
| 293 |
\f[B]rpmsign\f[R](8) |
| 294 |
.PP |
| 295 |
\f[B]rpmbuild \-\-help\f[R] \- as rpm supports customizing the options |
| 296 |
via popt aliases it\[aq]s impossible to guarantee that what\[aq]s |
| 297 |
described in the manual matches what\[aq]s available. |
| 298 |
.PP |
| 299 |
\f[B]http://www.rpm.org/ <URL:http://www.rpm.org/>\f[R] |
| 300 |
.SH AUTHORS |
| 301 |
.IP |
| 302 |
.EX |
| 303 |
Marc Ewing <marc\[at]redhat.com> |
| 304 |
Jeff Johnson <jbj\[at]redhat.com> |
| 305 |
Erik Troan <ewt\[at]redhat.com> |
| 306 |
.EE |