1RPMBUILD(8) Red Hat Linux RPMBUILD(8)
2
3
4
6 rpmbuild - Build RPM Package(s)
7
9 BUILDING PACKAGES:
10 rpmbuild {-ba|-bb|-bp|-bc|-bi|-bl|-bs} [rpmbuild-options] SPECFILE ...
11
12
13
14 rpmbuild {-ta|-tb|-tp|-tc|-ti|-tl|-ts} [rpmbuild-options] TARBALL ...
15
16
17
18 rpmbuild {--rebuild|--recompile} SOURCEPKG ...
19
20
21 MISCELLANEOUS:
22 rpmbuild --showrc
23
24
25 rpmbuild-options
26 [--buildroot DIRECTORY] [--clean] [--nobuild]
27 [--rmsource] [--rmspec] [--short-circuit] [--sign]
28 [--target PLATFORM]
29
30
32 rpmbuild is used to build both binary and source software packages. A
33 package consists of an archive of files and meta-data used to install
34 and erase the archive files. The meta-data includes helper scripts,
35 file attributes, and descriptive information about the package. Pack‐
36 ages come in two varieties: binary packages, used to encapsulate soft‐
37 ware to be installed, and source packages, containing the source code
38 and recipe necessary to produce binary packages.
39
40 One of the following basic modes must be selected: Build Package, Build
41 Package from Tarball, Recompile Package, Show Configuration.
42
43 GENERAL OPTIONS
44 These options can be used in all the different modes.
45
46 -?, --help
47 Print a longer usage message then normal.
48
49 --version
50 Print a single line containing the version number of rpm being
51 used.
52
53 --quiet
54 Print as little as possible - normally only error messages will
55 be displayed.
56
57 -v Print verbose information - normally routine progress messages
58 will be displayed.
59
60 -vv Print lots of ugly debugging information.
61
62 --rcfile FILELIST
63 Each of the files in the colon separated FILELIST is read
64 sequentially by rpm for configuration information. Only the
65 first file in the list must exist, and tildes will be expanded
66 to the value of $HOME. The default FILELIST is
67 /usr/lib/rpm/rpmrc:/usr/lib/rpm/red‐
68 hat/rpmrc:/etc/rpmrc:~/.rpmrc.
69
70 --pipe CMD
71 Pipes the output of rpm to the command CMD.
72
73 --dbpath DIRECTORY
74 Use the database in DIRECTORY rather than the default path
75 /var/lib/rpm
76
77 --root DIRECTORY
78 Use the file system tree rooted at DIRECTORY for all operations.
79 Note that this means the database within DIRECTORY will be used
80 for dependency checks and any scriptlet(s) (e.g. %post if
81 installing, or %prep if building, a package) will be run after a
82 chroot(2) to DIRECTORY.
83
84 BUILD OPTIONS
85 The general form of an rpm build command is
86
87 rpmbuild -bSTAGE|-tSTAGE [ rpmbuild-options
88 ] FILE ...
89
90
91 The argument used is -b if a spec file is being used to build the pack‐
92 age and -t if rpmbuild should look inside of a (possibly compressed)
93 tar file for the spec file to use. After the first argument, the next
94 character (STAGE) specifies the stages of building and packaging to be
95 done and is one of:
96
97 -ba Build binary and source packages (after doing the %prep, %build,
98 and %install stages).
99
100 -bb Build a binary package (after doing the %prep, %build, and
101 %install stages).
102
103 -bp Executes the "%prep" stage from the spec file. Normally this
104 involves unpacking the sources and applying any patches.
105
106 -bc Do the "%build" stage from the spec file (after doing the %prep
107 stage). This generally involves the equivalent of a "make".
108
109 -bi Do the "%install" stage from the spec file (after doing the
110 %prep and %build stages). This generally involves the equiva‐
111 lent of a "make install".
112
113 -bl Do a "list check". The "%files" section from the spec file is
114 macro expanded, and checks are made to verify that each file
115 exists.
116
117 -bs Build just the source package.
118
119 The following options may also be used:
120
121 --buildroot DIRECTORY
122 When building a package, override the BuildRoot tag with direc‐
123 tory DIRECTORY.
124
125 --clean
126 Remove the build tree after the packages are made.
127
128 --nobuild
129 Do not execute any build stages. Useful for testing out spec
130 files.
131
132 --rmsource
133 Remove the sources after the build (may also be used standalone,
134 e.g. "rpmbuild --rmsource foo.spec").
135
136 --rmspec
137 Remove the spec file after the build (may also be used stand‐
138 alone, eg. "rpmbuild --rmspec foo.spec").
139
140 --short-circuit
141 Skip straight to specified stage (i.e., skip all stages leading
142 up to the specified stage). Only valid with -bc and -bi.
143
144 --sign Embed a GPG signature in the package. This signature can be used
145 to verify the integrity and the origin of the package. See the
146 section on GPG SIGNATURES in rpm(8) for configuration details.
147
148 --target PLATFORM
149 When building the package, interpret PLATFORM as arch-vendor-os
150 and set the macros %_target, %_target_cpu, and %_target_os
151 accordingly.
152
153 REBUILD AND RECOMPILE OPTIONS
154 There are two other ways to invoke building with rpm:
155
156 rpmbuild --rebuild|--recompile SOURCEPKG ...
157
158
159 When invoked this way, rpmbuild installs the named source package, and
160 does a prep, compile and install. In addition, --rebuild builds a new
161 binary package. When the build has completed, the build directory is
162 removed (as in --clean) and the the sources and spec file for the pack‐
163 age are removed.
164
165 SHOWRC
166 The command
167
168 rpmbuild --showrc
169
170
171 shows the values rpmbuild will use for all of the options are currently
172 set in rpmrc and macros configuration file(s).
173
175 rpmrc Configuration
176 /usr/lib/rpm/rpmrc
177 /usr/lib/rpm/redhat/rpmrc
178 /etc/rpmrc
179 ~/.rpmrc
180
181 Macro Configuration
182 /usr/lib/rpm/macros
183 /usr/lib/rpm/redhat/macros
184 /etc/rpm/macros
185 ~/.rpmmacros
186
187 Database
188 /var/lib/rpm/Basenames
189 /var/lib/rpm/Conflictname
190 /var/lib/rpm/Dirnames
191 /var/lib/rpm/Filemd5s
192 /var/lib/rpm/Group
193 /var/lib/rpm/Installtid
194 /var/lib/rpm/Name
195 /var/lib/rpm/Packages
196 /var/lib/rpm/Providename
197 /var/lib/rpm/Provideversion
198 /var/lib/rpm/Pubkeys
199 /var/lib/rpm/Removed
200 /var/lib/rpm/Requirename
201 /var/lib/rpm/Requireversion
202 /var/lib/rpm/Sha1header
203 /var/lib/rpm/Sigmd5
204 /var/lib/rpm/Triggername
205
206 Temporary
207 /var/tmp/rpm*
208
210 popt(3),
211 rpm2cpio(8),
212 gendiff(1),
213 rpm(8),
214
215 rpmbuild --help - as rpm supports customizing the options via popt
216 aliases it's impossible to guarantee that what's described in the man‐
217 ual matches what's available.
218
219 http://www.rpm.org/ <URL:http://www.rpm.org/>
220
222 Marc Ewing <marc@redhat.com>
223 Jeff Johnson <jbj@redhat.com>
224 Erik Troan <ewt@redhat.com>
225
226
227
228Red Hat, Inc. 09 June 2002 RPMBUILD(8)