fca4250173c6ce64bc461b0efe242b0292ea9661
[platform/upstream/rpm.git] / doc / rpmbuild.8
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."
7 .SH NAME
8 rpmbuild \- Build RPM Package(s)
9 .SH SYNOPSIS
10 .SS "BUILDING PACKAGES:"
11 .PP
12
13
14 \fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR
15
16
17
18 \fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR
19
20
21
22 \fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR
23
24 .SS "MISCELLANEOUS:"
25 .PP
26
27
28 \fBrpmbuild\fR \fB--showrc\fR
29
30 .SS "rpmbuild-options"
31 .PP
32
33
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]
38
39 .SH "DESCRIPTION"
40 .PP
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
45 about the package.
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
49 packages.
50 .PP
51 One of the following basic modes must be selected:
52 \fBBuild Package\fR,
53 \fBBuild Package from Tarball\fR,
54 \fBRecompile Package\fR,
55 \fBShow Configuration\fR.
56 .SS "GENERAL OPTIONS"
57 .PP
58 These options can be used in all the different modes.
59 .TP
60 \fB-?, --help\fR
61 Print a longer usage message then normal.
62 .TP
63 \fB--version\fR
64 Print a single line containing the version number of \fBrpm\fR
65 being used. 
66 .TP
67 \fB--quiet\fR
68 Print as little as possible - normally only error messages will
69 be displayed.
70 .TP
71 \fB-v\fR
72 Print verbose information - normally routine progress messages will be
73 displayed.
74 .TP
75 \fB-vv\fR
76 Print lots of ugly debugging information.
77 .TP
78 \fB--rcfile \fIFILELIST\fB\fR
79 Each of the files in the colon separated
80 \fIFILELIST\fR
81 is read sequentially by \fBrpm\fR for configuration
82 information.
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.
87 .TP
88 \fB--pipe \fICMD\fB\fR
89 Pipes the output of \fBrpm\fR to the command \fICMD\fR.
90 .TP
91 \fB--dbpath \fIDIRECTORY\fB\fR
92 Use the database in \fIDIRECTORY\fR rather
93 than the default path \fI/var/lib/rpm\fR
94 .TP
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
98 \fIDIRECTORY\fR
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
103 \fIDIRECTORY\fR.
104 .TP
105 \fB-D, --define='\fIMACRO EXPR\fB'\fR
106 Defines \fIMACRO\fR with value \fIEXPR\fR.
107 .SS "BUILD OPTIONS"
108 .PP
109 The general form of an rpm build command is 
110 .PP
111
112 \fBrpmbuild\fR \fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR [ \fB     rpmbuild-options
113 \fR ] \fB\fIFILE\fB\fR\fI ...\fR
114
115 .PP
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:
122 .TP
123 \fB-ba\fR
124 Build binary and source packages (after doing the %prep, %build, and
125 %install stages).
126 .TP
127 \fB-bb\fR
128 Build a binary package (after doing the %prep, %build, and %install
129 stages).
130 .TP
131 \fB-bp\fR
132 Executes the "%prep" stage from the spec file. Normally this
133 involves unpacking the sources and applying any patches.
134 .TP
135 \fB-bc\fR
136 Do the "%build" stage from the spec file (after doing the %prep stage).
137 This generally involves the equivalent of a "make".
138 .TP
139 \fB-bi\fR
140 Do the "%install" stage from the spec file (after doing the %prep and
141 %build stages).  This generally involves the equivalent of a
142 "make install".
143 .TP
144 \fB-bl\fR
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
147 exists.
148 .TP
149 \fB-bs\fR
150 Build just the source package.
151 .PP
152 The following options may also be used:
153 .TP
154 \fB--buildroot \fIDIRECTORY\fB\fR
155 When building a package, override the BuildRoot tag with directory
156 \fIDIRECTORY\fR.
157 .TP
158 \fB--clean\fR
159 Remove the build tree after the packages are made.
160 .TP
161 \fB--nobuild\fR
162 Do not execute any build stages. Useful for testing out spec files.
163 .TP
164 \fB--noclean\fR
165 Do not execute %clean build stage even if present in spec.
166 .TP
167 \fB--nocheck\fR
168 Do not execute %check build stage even if present in spec.
169 .TP
170 \fB--nodeps\fR
171 Do not verify build dependencies.
172 .TP
173 \fB--rmsource\fR
174 Remove the sources after the build (may also be
175 used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR").
176 .TP
177 \fB--rmspec\fR
178 Remove the spec file after the build (may also be
179 used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR").
180 .TP
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.
187 .TP
188 \fB--target \fIPLATFORM\fB\fR
189 When building the package, interpret \fIPLATFORM\fR
190 as \fBarch-vendor-os\fR and set the macros
191 \fB%_target\fR,
192 \fB%_target_cpu\fR, and
193 \fB%_target_os\fR
194 accordingly.
195 .SS "REBUILD AND RECOMPILE OPTIONS"
196 .PP
197 There are two other ways to invoke building with rpm:
198 .PP
199
200 \fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR
201
202 .PP
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.
209 .SS "SHOWRC"
210 .PP
211 The command
212 .PP
213
214 \fBrpmbuild\fR \fB--showrc\fR
215
216 .PP
217 shows the values \fBrpmbuild\fR will use for all of the
218 options are currently set in
219 \fIrpmrc\fR and
220 \fImacros\fR
221 configuration file(s).
222 .SH "FILES"
223 .SS "rpmrc Configuration"
224 .PP
225 .nf
226 \fI/usr/lib/rpm/rpmrc\fR
227 \fI/usr/lib/rpm/redhat/rpmrc\fR
228 \fI/etc/rpmrc\fR
229 \fI~/.rpmrc\fR
230 .fi
231 .SS "Macro Configuration"
232 .PP
233 .nf
234 \fI/usr/lib/rpm/macros\fR
235 \fI/usr/lib/rpm/redhat/macros\fR
236 \fI/etc/rpm/macros\fR
237 \fI~/.rpmmacros\fR
238 .fi
239 .SS "Temporary"
240 .PP
241 \fI/var/tmp/rpm*\fR
242 .SH "SEE ALSO"
243
244 .nf
245 \fBgendiff\fR(1),
246 \fBpopt\fR(3),
247 \fBrpm\fR(8),
248 \fBrpm2cpio\fR(8),
249 \fBrpmkeys\fR(8)
250 \fBrpmspec\fR(8),
251 \fBrpmsign\fR(8),
252 .fi
253
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.
257
258 \fBhttp://www.rpm.org/ <URL:http://www.rpm.org/>
259 \fR
260 .SH "AUTHORS"
261
262 .nf
263 Marc Ewing <marc@redhat.com>
264 Jeff Johnson <jbj@redhat.com>
265 Erik Troan <ewt@redhat.com>
266 .fi