1 .\" This manpage has been automatically generated by docbook2man
2 .\" from a DocBook document. This tool can be found at:
3 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
4 .\" Please send any bug reports, improvements, comments, patches,
5 .\" etc. to Steve Cheng <steve@ggi-project.org>.
6 .TH "RPMBUILD" "8" "09 June 2002" "Red Hat, Inc."
8 rpmbuild \- Build RPM Package(s)
10 .SS "BUILDING PACKAGES:"
14 \fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR
18 \fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR
22 \fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR
28 \fBrpmbuild\fR \fB--showrc\fR
30 .SS "rpmbuild-options"
34 [\fB--buildroot \fIDIRECTORY\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR]
35 [\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR]
36 [\fB--noclean\fR] [\fB--nocheck\fR]
37 [\fB--target \fIPLATFORM\fB\fR]
41 \fBrpmbuild\fR is used to build both binary and source software packages.
42 A \fBpackage\fR consists of an archive of files and
43 meta-data used to install and erase the archive files. The meta-data
44 includes helper scripts, file attributes, and descriptive information
46 \fBPackages\fR come in two varieties: binary packages,
47 used to encapsulate software to be installed, and source packages,
48 containing the source code and recipe necessary to produce binary
51 One of the following basic modes must be selected:
53 \fBBuild Package from Tarball\fR,
54 \fBRecompile Package\fR,
55 \fBShow Configuration\fR.
58 These options can be used in all the different modes.
61 Print a longer usage message then normal.
64 Print a single line containing the version number of \fBrpm\fR
68 Print as little as possible - normally only error messages will
72 Print verbose information - normally routine progress messages will be
76 Print lots of ugly debugging information.
78 \fB--rcfile \fIFILELIST\fB\fR
79 Each of the files in the colon separated
81 is read sequentially by \fBrpm\fR for configuration
83 Only the first file in the list must exist, and tildes will be
84 expanded to the value of \fB$HOME\fR.
85 The default \fIFILELIST\fR is
86 \fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR.
88 \fB--pipe \fICMD\fB\fR
89 Pipes the output of \fBrpm\fR to the command \fICMD\fR.
91 \fB--dbpath \fIDIRECTORY\fB\fR
92 Use the database in \fIDIRECTORY\fR rather
93 than the default path \fI/var/lib/rpm\fR
95 \fB--root \fIDIRECTORY\fB\fR
96 Use the file system tree rooted at \fIDIRECTORY\fR for all operations.
97 Note that this means the database within
99 will be used for dependency checks and any scriptlet(s) (e.g.
100 \fB%post\fR if installing, or
101 \fB%prep\fR if building, a package)
102 will be run after a chroot(2) to
105 \fB-D, --define='\fIMACRO EXPR\fB'\fR
106 Defines \fIMACRO\fR with value \fIEXPR\fR.
109 The general form of an rpm build command is
112 \fBrpmbuild\fR \fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR [ \fB rpmbuild-options
113 \fR ] \fB\fIFILE\fB\fR\fI ...\fR
116 The argument used is \fB-b\fR if a spec file is being
117 used to build the package and \fB-t\fR if \fBrpmbuild\fR
118 should look inside of a (possibly compressed) tar file for
119 the spec file to use. After the first argument, the next
120 character (\fISTAGE\fR) specifies the stages
121 of building and packaging to be done and is one of:
124 Build binary and source packages (after doing the %prep, %build, and
128 Build a binary package (after doing the %prep, %build, and %install
132 Executes the "%prep" stage from the spec file. Normally this
133 involves unpacking the sources and applying any patches.
136 Do the "%build" stage from the spec file (after doing the %prep stage).
137 This generally involves the equivalent of a "make".
140 Do the "%install" stage from the spec file (after doing the %prep and
141 %build stages). This generally involves the equivalent of a
145 Do a "list check". The "%files" section from the spec file is
146 macro expanded, and checks are made to verify that each file
150 Build just the source package.
152 The following options may also be used:
154 \fB--buildroot \fIDIRECTORY\fB\fR
155 When building a package, override the BuildRoot tag with directory
159 Remove the build tree after the packages are made.
162 Do not execute any build stages. Useful for testing out spec files.
165 Do not execute %clean build stage even if present in spec.
168 Do not execute %check build stage even if present in spec.
171 Do not verify build dependencies.
174 Remove the sources after the build (may also be
175 used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR").
178 Remove the spec file after the build (may also be
179 used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR").
181 \fB--short-circuit\fR
182 Skip straight to specified stage (i.e., skip all stages leading
183 up to the specified stage). Only valid with \fB-bc\fR, \fB-bi\fR,
184 and \fB-bb\fR. Useful for local testing only. Packages built this
185 way will be marked with an unsatisfiable dependency to prevent
186 their accidental use.
188 \fB--target \fIPLATFORM\fB\fR
189 When building the package, interpret \fIPLATFORM\fR
190 as \fBarch-vendor-os\fR and set the macros
192 \fB%_target_cpu\fR, and
195 .SS "REBUILD AND RECOMPILE OPTIONS"
197 There are two other ways to invoke building with rpm:
200 \fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR
203 When invoked this way, \fBrpmbuild\fR installs the named source
204 package, and does a prep, compile and install. In addition,
205 \fB--rebuild\fR builds a new binary package. When the build
206 has completed, the build directory is removed (as in
207 \fB--clean\fR) and the the sources and spec file for
208 the package are removed.
214 \fBrpmbuild\fR \fB--showrc\fR
217 shows the values \fBrpmbuild\fR will use for all of the
218 options are currently set in
221 configuration file(s).
223 .SS "rpmrc Configuration"
226 \fI/usr/lib/rpm/rpmrc\fR
227 \fI/usr/lib/rpm/redhat/rpmrc\fR
231 .SS "Macro Configuration"
234 \fI/usr/lib/rpm/macros\fR
235 \fI/usr/lib/rpm/redhat/macros\fR
236 \fI/etc/rpm/macros\fR
254 \fBrpmbuild --help\fR - as rpm supports customizing the options via popt
255 aliases it's impossible to guarantee that what's described in the manual
256 matches what's available.
258 \fBhttp://www.rpm.org/ <URL:http://www.rpm.org/>
263 Marc Ewing <marc@redhat.com>
264 Jeff Johnson <jbj@redhat.com>
265 Erik Troan <ewt@redhat.com>