54326082f1771bdf54445600de2c652a8d170a88
[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] [\fB--sign\fR]
36  [\fB--target \fIPLATFORM\fB\fR]
37
38 .SH "DESCRIPTION"
39 .PP
40 \fBrpmbuild\fR is used to build both binary and source software packages.
41 A \fBpackage\fR consists of an archive of files and
42 meta-data used to install and erase the archive files. The meta-data
43 includes helper scripts, file attributes, and descriptive information
44 about the package.
45 \fBPackages\fR come in two varieties: binary packages,
46 used to encapsulate software to be installed, and source packages,
47 containing the source code and recipe necessary to produce binary
48 packages.
49 .PP
50 One of the following basic modes must be selected:
51 \fBBuild Package\fR,
52 \fBBuild Package from Tarball\fR,
53 \fBRecompile Package\fR,
54 \fBShow Configuration\fR.
55 .SS "GENERAL OPTIONS"
56 .PP
57 These options can be used in all the different modes.
58 .TP
59 \fB-?, --help\fR
60 Print a longer usage message then normal.
61 .TP
62 \fB--version\fR
63 Print a single line containing the version number of \fBrpm\fR
64 being used. 
65 .TP
66 \fB--quiet\fR
67 Print as little as possible - normally only error messages will
68 be displayed.
69 .TP
70 \fB-v\fR
71 Print verbose information - normally routine progress messages will be
72 displayed.
73 .TP
74 \fB-vv\fR
75 Print lots of ugly debugging information.
76 .TP
77 \fB--rcfile \fIFILELIST\fB\fR
78 Each of the files in the colon separated
79 \fIFILELIST\fR
80 is read sequentially by \fBrpm\fR for configuration
81 information.
82 Only the first file in the list must exist, and tildes will be
83 expanded to the value of \fB$HOME\fR.
84 The default \fIFILELIST\fR is
85 \fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR.
86 .TP
87 \fB--pipe \fICMD\fB\fR
88 Pipes the output of \fBrpm\fR to the command \fICMD\fR.
89 .TP
90 \fB--dbpath \fIDIRECTORY\fB\fR
91 Use the database in \fIDIRECTORY\fR rather
92 than the default path \fI/var/lib/rpm\fR
93 .TP
94 \fB--root \fIDIRECTORY\fB\fR
95 Use the file system tree rooted at \fIDIRECTORY\fR for all operations.
96 Note that this means the database within
97 \fIDIRECTORY\fR
98 will be used for dependency checks and any scriptlet(s) (e.g.
99 \fB%post\fR if installing, or
100 \fB%prep\fR if building, a package)
101 will be run after a chroot(2) to
102 \fIDIRECTORY\fR.
103 .SS "BUILD OPTIONS"
104 .PP
105 The general form of an rpm build command is 
106 .PP
107
108 \fBrpmbuild\fR \fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR [ \fB     rpmbuild-options
109 \fR ] \fB\fIFILE\fB\fR\fI ...\fR
110
111 .PP
112 The argument used is \fB-b\fR if a spec file is being
113 used to build the package and \fB-t\fR if \fBrpmbuild\fR
114 should look inside of a (possibly compressed) tar file for
115 the spec file to use. After the first argument, the next
116 character (\fISTAGE\fR) specifies the stages
117 of building and packaging to be done and is one of:
118 .TP
119 \fB-ba\fR
120 Build binary and source packages (after doing the %prep, %build, and
121 %install stages).
122 .TP
123 \fB-bb\fR
124 Build a binary package (after doing the %prep, %build, and %install
125 stages).
126 .TP
127 \fB-bp\fR
128 Executes the "%prep" stage from the spec file. Normally this
129 involves unpacking the sources and applying any patches.
130 .TP
131 \fB-bc\fR
132 Do the "%build" stage from the spec file (after doing the %prep stage).
133 This generally involves the equivalent of a "make".
134 .TP
135 \fB-bi\fR
136 Do the "%install" stage from the spec file (after doing the %prep and
137 %build stages).  This generally involves the equivalent of a
138 "make install".
139 .TP
140 \fB-bl\fR
141 Do a "list check".  The "%files" section from the spec file is
142 macro expanded, and checks are made to verify that each file
143 exists.
144 .TP
145 \fB-bs\fR
146 Build just the source package.
147 .PP
148 The following options may also be used:
149 .TP
150 \fB--buildroot \fIDIRECTORY\fB\fR
151 When building a package, override the BuildRoot tag with directory
152 \fIDIRECTORY\fR.
153 .TP
154 \fB--clean\fR
155 Remove the build tree after the packages are made.
156 .TP
157 \fB--nobuild\fR
158 Do not execute any build stages. Useful for testing out spec files.
159 .TP
160 \fB--nodeps\fR
161 Do not verify build dependencies.
162 .TP
163 \fB--rmsource\fR
164 Remove the sources after the build (may also be
165 used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR").
166 .TP
167 \fB--rmspec\fR
168 Remove the spec file after the build (may also be
169 used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR").
170 .TP
171 \fB--short-circuit\fR
172 Skip straight to specified stage (i.e., skip all stages leading
173 up to the specified stage).  Only valid with \fB-bc\fR, \fB-bi\fR,
174 and \fB-bb\fR.  Useful for local testing only.  Packages built this
175 way will be marked with an unsatisfiable dependency to prevent
176 their accidental use.
177 .TP
178 \fB--sign\fR
179 Embed a GPG signature in the package. This signature can be used
180 to verify the integrity and the origin of the package.  See the
181 section on GPG SIGNATURES in
182 \fBrpm\fR(8)
183 for configuration details.
184 .TP
185 \fB--target \fIPLATFORM\fB\fR
186 When building the package, interpret \fIPLATFORM\fR
187 as \fBarch-vendor-os\fR and set the macros
188 \fB%_target\fR,
189 \fB%_target_cpu\fR, and
190 \fB%_target_os\fR
191 accordingly.
192 .SS "REBUILD AND RECOMPILE OPTIONS"
193 .PP
194 There are two other ways to invoke building with rpm:
195 .PP
196
197 \fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR
198
199 .PP
200 When invoked this way, \fBrpmbuild\fR installs the named source
201 package, and does a prep, compile and install.  In addition,
202 \fB--rebuild\fR builds a new binary package. When the build
203 has completed, the build directory is removed (as in
204 \fB--clean\fR) and the the sources and spec file for
205 the package are removed.
206 .SS "SHOWRC"
207 .PP
208 The command
209 .PP
210
211 \fBrpmbuild\fR \fB--showrc\fR
212
213 .PP
214 shows the values \fBrpmbuild\fR will use for all of the
215 options are currently set in
216 \fIrpmrc\fR and
217 \fImacros\fR
218 configuration file(s).
219 .SH "FILES"
220 .SS "rpmrc Configuration"
221 .PP
222 .nf
223 \fI/usr/lib/rpm/rpmrc\fR
224 \fI/usr/lib/rpm/redhat/rpmrc\fR
225 \fI/etc/rpmrc\fR
226 \fI~/.rpmrc\fR
227 .fi
228 .SS "Macro Configuration"
229 .PP
230 .nf
231 \fI/usr/lib/rpm/macros\fR
232 \fI/usr/lib/rpm/redhat/macros\fR
233 \fI/etc/rpm/macros\fR
234 \fI~/.rpmmacros\fR
235 .fi
236 .SS "Database"
237 .PP
238 .nf
239 \fI/var/lib/rpm/Basenames\fR
240 \fI/var/lib/rpm/Conflictname\fR
241 \fI/var/lib/rpm/Dirnames\fR
242 \fI/var/lib/rpm/Filemd5s\fR
243 \fI/var/lib/rpm/Group\fR
244 \fI/var/lib/rpm/Installtid\fR
245 \fI/var/lib/rpm/Name\fR
246 \fI/var/lib/rpm/Packages\fR
247 \fI/var/lib/rpm/Providename\fR
248 \fI/var/lib/rpm/Provideversion\fR
249 \fI/var/lib/rpm/Pubkeys\fR
250 \fI/var/lib/rpm/Removed\fR
251 \fI/var/lib/rpm/Requirename\fR
252 \fI/var/lib/rpm/Requireversion\fR
253 \fI/var/lib/rpm/Sha1header\fR
254 \fI/var/lib/rpm/Sigmd5\fR
255 \fI/var/lib/rpm/Triggername\fR
256 .fi
257 .SS "Temporary"
258 .PP
259 \fI/var/tmp/rpm*\fR
260 .SH "SEE ALSO"
261
262 .nf
263 \fBpopt\fR(3),
264 \fBrpm2cpio\fR(8),
265 \fBgendiff\fR(1),
266 \fBrpm\fR(8),
267 .fi
268
269 \fBrpmbuild --help\fR - as rpm supports customizing the options via popt 
270 aliases it's impossible to guarantee that what's described in the manual 
271 matches what's available.
272
273 \fBhttp://www.rpm.org/ <URL:http://www.rpm.org/>
274 \fR
275 .SH "AUTHORS"
276
277 .nf
278 Marc Ewing <marc@redhat.com>
279 Jeff Johnson <jbj@redhat.com>
280 Erik Troan <ewt@redhat.com>
281 .fi