1RPMBUILD(8) System Manager's Manual RPMBUILD(8)
2
3
4
6 rpmbuild - Build RPM Package(s)
7
9 BUILDING PACKAGES:
10 rpmbuild {-ba|-bb|-bp|-bc|-bi|-bl|-bs|-br} [rpmbuild-options] SPECFILE
11 ...
12
13
14 rpmbuild {-ra|-rb|-rp|-rc|-ri|-rl|-rs|-rr} [rpmbuild-options] SOUR‐
15 CEPACKAGE ...
16
17
18 rpmbuild {-ta|-tb|-tp|-tc|-ti|-tl|-ts|-tr} [rpmbuild-options] TARBALL
19 ...
20
21
22
23 rpmbuild {--rebuild|--recompile} SOURCEPKG ...
24
25
26 MISCELLANEOUS:
27 rpmbuild --showrc
28
29
30 rpmbuild-options
31 [--buildroot DIRECTORY] [--clean] [--nobuild]
32 [--rmsource] [--rmspec] [--short-circuit] [--build-in-place]
33 [--noprep] [--noclean] [--nocheck]
34 [--rpmfcdebug]
35 [--target PLATFORM]
36 [--with OPTION] [--without OPTION]
37
38
40 rpmbuild is used to build both binary and source software packages. A
41 package consists of an archive of files and meta-data used to install
42 and erase the archive files. The meta-data includes helper scripts,
43 file attributes, and descriptive information about the package. Pack‐
44 ages come in two varieties: binary packages, used to encapsulate soft‐
45 ware to be installed, and source packages, containing the source code
46 and recipe necessary to produce binary packages.
47
48 One of the following basic modes must be selected: Build Package, Build
49 Package from Tarball, Recompile Package, Show Configuration.
50
51 GENERAL OPTIONS
52 These options can be used in all the different modes.
53
54 -?, --help
55 Print a longer usage message then normal.
56
57 --version
58 Print a single line containing the version number of rpm being
59 used.
60
61 --quiet
62 Print as little as possible - normally only error messages will
63 be displayed.
64
65 -v Print verbose information - normally routine progress messages
66 will be displayed.
67
68 -vv Print lots of ugly debugging information.
69
70 --rpmfcdebug
71 Enables to debug dependencies generation.
72
73 --rcfile FILELIST
74 Each of the files in the colon separated FILELIST is read
75 sequentially by rpm for configuration information. Only the
76 first file in the list must exist, and tildes will be expanded
77 to the value of $HOME. The default FILELIST is
78 /usr/lib/rpm/rpmrc:/usr/lib/rpm/<ven‐
79 dor>/rpmrc:/etc/rpmrc:~/.rpmrc.
80
81 --pipe CMD
82 Pipes the output of rpm to the command CMD.
83
84 --dbpath DIRECTORY
85 Use the database in DIRECTORY rather than the default path
86 /var/lib/rpm
87
88 --root DIRECTORY
89 Use the file system tree rooted at DIRECTORY for all operations.
90 Note that this means the database within DIRECTORY will be used
91 for dependency checks and any scriptlet(s) (e.g. %post if
92 installing, or %prep if building, a package) will be run after a
93 chroot(2) to DIRECTORY.
94
95 -D, --define='MACRO EXPR'
96 Defines MACRO with value EXPR.
97
98 --scm=SCM
99 Select the SCM to use with %autosetup, if one is not set in the
100 spec file. Note that not all values for SCM, e.g., patch (the
101 default) and gendiff, git, or quilt work interchangeably with
102 all other patches and options stated in the %autosetup line,
103 especially option -pN.
104
105 BUILD OPTIONS
106 The general form of an rpm build command is
107
108 rpmbuild {-bSTAGE|-rSTAGE|-tSTAGE} [rpmbuild-options] FILE ...
109
110
111 The argument used is -b if a spec file is being used to build the pack‐
112 age, -r if a source package is to be rebuild and -t if rpmbuild should
113 look inside of a (possibly compressed) tar file for the spec file to
114 use. After the first argument, the next character (STAGE) specifies the
115 stages of building and packaging to be done and is one of:
116
117 -ba Build binary and source packages (after doing the %prep, %build,
118 and %install stages).
119
120 -bb Build a binary package (after doing the %prep, %build, and
121 %install stages).
122
123 -bp Executes the "%prep" stage from the spec file. Normally this
124 involves unpacking the sources and applying any patches.
125
126 -bc Do the "%build" stage from the spec file (after doing the %prep
127 stage). This generally involves the equivalent of a "make".
128
129 -bi Do the "%install" stage from the spec file (after doing the
130 %prep and %build stages). This generally involves the equiva‐
131 lent of a "make install".
132
133 -bl Do a "list check". The "%files" section from the spec file is
134 macro expanded, and checks are made to verify that each file
135 exists.
136
137 -bs Build just the source package.
138
139 -br Build just the source package - but calculate and include the
140 dynamic build requires.
141
142 The following options may also be used:
143
144 --buildroot DIRECTORY
145 When building a package, override the BuildRoot tag with direc‐
146 tory DIRECTORY.
147
148 --clean
149 Remove the build tree after the packages are made.
150
151 --nobuild
152 Do not execute any build stages. Useful for testing out spec
153 files.
154
155 --noprep
156 Do not execute %prep build stage even if present in spec.
157
158 --noclean
159 Do not execute %clean build stage even if present in spec.
160
161 --nocheck
162 Do not execute %check build stage even if present in spec.
163
164 --nodebuginfo
165 Do not generate debuginfo packages.
166
167 --nodeps
168 Do not verify build dependencies.
169
170 --rmsource
171 Remove the sources after the build (may also be used standalone,
172 e.g. "rpmbuild --rmsource foo.spec").
173
174 --rmspec
175 Remove the spec file after the build (may also be used stand‐
176 alone, eg. "rpmbuild --rmspec foo.spec").
177
178 --short-circuit
179 Skip straight to specified stage (i.e., skip all stages leading
180 up to the specified stage). Only valid with -bc, -bi, and -bb.
181 Useful for local testing only. Packages built this way will be
182 marked with an unsatisfiable dependency to prevent their acci‐
183 dental use.
184
185 --build-in-place
186 Build from locally checked out sources. Sets _builddir to cur‐
187 rent working directory. Skips handling of -n and untar in the
188 %setup and the deletion of the buildSubdir.
189
190 --target PLATFORM
191 When building the package, interpret PLATFORM as arch-vendor-os
192 and set the macros %_target, %_target_cpu, and %_target_os
193 accordingly.
194
195 --with OPTION
196 Enable configure OPTION for build.
197
198 --without OPTION
199 Disable configure OPTION for build.
200
201 REBUILD AND RECOMPILE OPTIONS
202 There are two other ways to invoke building with rpm:
203
204 rpmbuild --rebuild|--recompile SOURCEPKG ...
205
206
207 When invoked this way, rpmbuild installs the named source package, and
208 does a prep, compile and install. In addition, --rebuild builds a new
209 binary package. When the build has completed, the build directory is
210 removed (as in --clean) and the the sources and spec file for the pack‐
211 age are removed.
212
213 These options are now superseded by the -r* options which allow much
214 more fine control over what stages of the build to run.
215
216 SHOWRC
217 The command
218
219 rpmbuild --showrc
220
221
222 shows the values rpmbuild will use for all of the options are currently
223 set in rpmrc and macros configuration file(s).
224
226 rpmrc Configuration
227 /usr/lib/rpm/rpmrc
228 /usr/lib/rpm/<vendor>/rpmrc
229 /etc/rpmrc
230 ~/.rpmrc
231
232 Macro Configuration
233 /usr/lib/rpm/macros
234 /usr/lib/rpm/<vendor>/macros
235 /etc/rpm/macros
236 ~/.rpmmacros
237
238 Temporary
239 /var/tmp/rpm*
240
242 gendiff(1),
243 popt(3),
244 rpm(8),
245 rpm2cpio(8),
246 rpmkeys(8)
247 rpmspec(8),
248 rpmsign(8),
249
250 rpmbuild --help - as rpm supports customizing the options via popt
251 aliases it's impossible to guarantee that what's described in the man‐
252 ual matches what's available.
253
254 http://www.rpm.org/ <URL:http://www.rpm.org/>
255
257 Marc Ewing <marc@redhat.com>
258 Jeff Johnson <jbj@redhat.com>
259 Erik Troan <ewt@redhat.com>
260
261
262
263Red Hat, Inc. 09 June 2002 RPMBUILD(8)