summaryrefslogtreecommitdiff
path: root/doc/rpmbuild.8
blob: 3f5bce43c2f7e2d3d2e17d4a9c09c114bff0d91b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
.\" This manpage has been automatically generated by docbook2man 
.\" from a DocBook document.  This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
.\" Please send any bug reports, improvements, comments, patches, 
.\" etc. to Steve Cheng <steve@ggi-project.org>.
.TH "RPMBUILD" "8" "09 June 2002" "Red Hat, Inc." "Red Hat Linux"
.SH NAME
rpmbuild \- Build RPM Package(s)
.SH SYNOPSIS
.SS "BUILDING PACKAGES:"
.PP


\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR



\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR



\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR

.SS "MISCELLANEOUS:"
.PP


\fBrpmbuild\fR \fB--showrc\fR

.SS "rpmbuild-options"
.PP


 [\fB--buildroot \fIDIRECTORY\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR]
 [\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR] [\fB--sign\fR]
 [\fB--target \fIPLATFORM\fB\fR]

.SH "DESCRIPTION"
.PP
\fBrpmbuild\fR is used to build both binary and source software packages.
A \fBpackage\fR 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.
\fBPackages\fR 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:
\fBBuild Package\fR,
\fBBuild Package from Tarball\fR,
\fBRecompile Package\fR,
\fBShow Configuration\fR.
.SS "GENERAL OPTIONS"
.PP
These options can be used in all the different modes.
.TP
\fB-?, --help\fR
Print a longer usage message then normal.
.TP
\fB--version\fR
Print a single line containing the version number of \fBrpm\fR
being used. 
.TP
\fB--quiet\fR
Print as little as possible - normally only error messages will
be displayed.
.TP
\fB-v\fR
Print verbose information - normally routine progress messages will be
displayed.
.TP
\fB-vv\fR
Print lots of ugly debugging information.
.TP
\fB--rcfile \fIFILELIST\fB\fR
Each of the files in the colon separated
\fIFILELIST\fR
is read sequentially by \fBrpm\fR for configuration
information.
Only the first file in the list must exist, and tildes will be
expanded to the value of \fB$HOME\fR.
The default \fIFILELIST\fR is
\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR.
.TP
\fB--pipe \fICMD\fB\fR
Pipes the output of \fBrpm\fR to the command \fICMD\fR.
.TP
\fB--dbpath \fIDIRECTORY\fB\fR
Use the database in \fIDIRECTORY\fR rather
than the default path \fI/var/lib/rpm\fR
.TP
\fB--root \fIDIRECTORY\fB\fR
Use the file system tree rooted at \fIDIRECTORY\fR for all operations.
Note that this means the database within
\fIDIRECTORY\fR
will be used for dependency checks and any scriptlet(s) (e.g.
\fB%post\fR if installing, or
\fB%prep\fR if building, a package)
will be run after a chroot(2) to
\fIDIRECTORY\fR.
.SS "BUILD OPTIONS"
.PP
The general form of an rpm build command is 
.PP

\fBrpmbuild\fR \fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR [ \fB     rpmbuild-options
\fR ] \fB\fIFILE\fB\fR\fI ...\fR

.PP
The argument used is \fB-b\fR if a spec file is being
used to build the package and \fB-t\fR if \fBrpmbuild\fR
should look inside of a (possibly compressed) tar file for
the spec file to use. After the first argument, the next
character (\fISTAGE\fR) specifies the stages
of building and packaging to be done and is one of:
.TP
\fB-ba\fR
Build binary and source packages (after doing the %prep, %build, and
%install stages).
.TP
\fB-bb\fR
Build a binary package (after doing the %prep, %build, and %install
stages).
.TP
\fB-bp\fR
Executes the "%prep" stage from the spec file. Normally this
involves unpacking the sources and applying any patches.
.TP
\fB-bc\fR
Do the "%build" stage from the spec file (after doing the %prep stage).
This generally involves the equivalent of a "make".
.TP
\fB-bi\fR
Do the "%install" stage from the spec file (after doing the %prep and
%build stages).  This generally involves the equivalent of a
"make install".
.TP
\fB-bl\fR
Do a "list check".  The "%files" section from the spec file is
macro expanded, and checks are made to verify that each file
exists.
.TP
\fB-bs\fR
Build just the source package.
.PP
The following options may also be used:
.TP
\fB--buildroot \fIDIRECTORY\fB\fR
When building a package, override the BuildRoot tag with directory
\fIDIRECTORY\fR.
.TP
\fB--clean\fR
Remove the build tree after the packages are made.
.TP
\fB--nobuild\fR
Do not execute any build stages. Useful for testing out spec files.
.TP
\fB--rmsource\fR
Remove the sources after the build (may also be
used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR").
.TP
\fB--rmspec\fR
Remove the spec file after the build (may also be
used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR").
.TP
\fB--short-circuit\fR
Skip straight to specified stage (i.e., skip all stages leading
up to the specified stage).  Only valid with \fB-bc\fR
and \fB-bi\fR.
.TP
\fB--sign\fR
Embed a GPG signature in the package. This signature can be used
to verify the integrity and the origin of the package.  See the
section on GPG SIGNATURES in
\fBrpm\fR(8)
for configuration details.
.TP
\fB--target \fIPLATFORM\fB\fR
When building the package, interpret \fIPLATFORM\fR
as \fBarch-vendor-os\fR and set the macros
\fB%_target\fR,
\fB%_target_cpu\fR, and
\fB%_target_os\fR
accordingly.
.SS "REBUILD AND RECOMPILE OPTIONS"
.PP
There are two other ways to invoke building with rpm:
.PP

\fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR

.PP
When invoked this way, \fBrpmbuild\fR installs the named source
package, and does a prep, compile and install.  In addition,
\fB--rebuild\fR builds a new binary package. When the build
has completed, the build directory is removed (as in
\fB--clean\fR) and the the sources and spec file for
the package are removed.
.SS "SHOWRC"
.PP
The command
.PP

\fBrpmbuild\fR \fB--showrc\fR

.PP
shows the values \fBrpmbuild\fR will use for all of the
options are currently set in
\fIrpmrc\fR and
\fImacros\fR
configuration file(s).
.SH "FILES"
.SS "rpmrc Configuration"
.PP
.nf
\fI/usr/lib/rpm/rpmrc\fR
\fI/usr/lib/rpm/redhat/rpmrc\fR
\fI/etc/rpmrc\fR
\fI~/.rpmrc\fR
.fi
.SS "Macro Configuration"
.PP
.nf
\fI/usr/lib/rpm/macros\fR
\fI/usr/lib/rpm/redhat/macros\fR
\fI/etc/rpm/macros\fR
\fI~/.rpmmacros\fR
.fi
.SS "Database"
.PP
.nf
\fI/var/lib/rpm/Basenames\fR
\fI/var/lib/rpm/Conflictname\fR
\fI/var/lib/rpm/Dirnames\fR
\fI/var/lib/rpm/Filemd5s\fR
\fI/var/lib/rpm/Group\fR
\fI/var/lib/rpm/Installtid\fR
\fI/var/lib/rpm/Name\fR
\fI/var/lib/rpm/Packages\fR
\fI/var/lib/rpm/Providename\fR
\fI/var/lib/rpm/Provideversion\fR
\fI/var/lib/rpm/Pubkeys\fR
\fI/var/lib/rpm/Removed\fR
\fI/var/lib/rpm/Requirename\fR
\fI/var/lib/rpm/Requireversion\fR
\fI/var/lib/rpm/Sha1header\fR
\fI/var/lib/rpm/Sigmd5\fR
\fI/var/lib/rpm/Triggername\fR
.fi
.SS "Temporary"
.PP
\fI/var/tmp/rpm*\fR
.SH "SEE ALSO"

.nf
\fBpopt\fR(3),
\fBrpm2cpio\fR(8),
\fBgendiff\fR(1),
\fBrpm\fR(8),
.fi

\fBrpmbuild --help\fR - as rpm supports customizing the options via popt 
aliases it's impossible to guarantee that what's described in the manual 
matches what's available.

\fBhttp://www.rpm.org/ <URL:http://www.rpm.org/>
\fR
.SH "AUTHORS"

.nf
Marc Ewing <marc@redhat.com>
Jeff Johnson <jbj@redhat.com>
Erik Troan <ewt@redhat.com>
.fi