1BUILD(1) General Commands Manual BUILD(1)
2
3
4
6 build - build packages in a reproducible way
7
9 build [--clean|--no-init] [--repo dir_or_url] [--repo...] [--root
10 buildroot] [recipefile]
11 build --help
12 build --verify
13
15 build is a tool to build binary packages in a safe and reproducible
16 way. The default is to build in a chroot sandbox, but build also sup‐
17 ports building in a virtual machine for better security.
18
19 If a recipe file is specified on the command line, build will use this
20 file and all other files in the directory for building the package. If
21 no recipe argument is provided, build will search the current directory
22 for a file.
23
24 The build tool understands the following recipe file types:
25
26 spec A specfile used to generate rpms.
27
28 src.rpm
29 A source rpm, which will be unpacked for the build.
30
31 kiwi A kiwi config file used to generate a kiwi image.
32
33 dsc A dsc file used to generate Debian binary packages.
34
35 PKGBUILD
36 A file used to generate Arch Linux binary packages.
37
38 build.collax
39 A shell script used to generate a Collax binary package.
40
42 --clean
43 Remove the build system and reinitialize it from scratch.
44
45 --no-init
46 Skip the build system initialization and start with build imme‐
47 diately.
48
49 --repo dir_or_url
50 Either a directory containing binary packages (optionally with
51 repository metadata), or a url pointing to some remote reposi‐
52 tory. Multiple --repo options can be used so create a specific
53 repository layering. Note that packages are searched in the
54 specified repository order, i.e. the first repository containing
55 a package with a specific name wins regardless of the version.
56 As a special form, 'zypp://reponame' can be used to specify a
57 system repository. 'zypp://' selects all enabled system reposi‐
58 tories. This is also the default if BUILD_RPMS is not set and no
59 --rpms or --repo option is used.
60
61 --dist distribution
62 Set the distribution. If this option is not given, build tries
63 to guess the distribution by looking at the available packages.
64 The specified distribution can either be a string like "11.2" or
65 "sles9", "debian7", or the pathname of the build configuration
66 to use.
67
68 --root buildroot
69 Specifies where the build system is set up. Overrides the
70 BUILD_ROOT enviroment variable.
71
72 --help Print a short help text.
73
74 --norootforbuild
75 Force building with user abuild. Otherwise, build searches the
76 recipe file for a "needsrootforbuild" hint to decide what user
77 to use.
78
79 --list-state
80 list packages that would be used to create a fresh build root.
81 Does not create the build root or perform a build.
82
83 --rpms path1:path2:path3...
84 Where build can find the packages needed to create the build
85 system. This option overrides the BUILD_RPMS environment vari‐
86 able. This option is deprecated, use --repo instead.
87
88 --arch arch1:arch2:arch3...
89 What architectures to select from the RPMs. build automatically
90 sets this to a sensible value for your host if you do not spec‐
91 ify this option so you should almost never need it.
92
93
95 --useusedforbuild
96 Tell build not to do dependency expansion, but to extract the
97 list of packages to install from "# usedforbuild" lines or, if
98 none are found, from all "BuildRequires" lines. This option is
99 useful if you want to re-build a package from a srcrpm with ex‐
100 actly the same packages used for the srcrpm build.
101
102 --stage
103 Set stage for rpmbuild. Defaults to 'a'. Append a trailing '='
104 to only run the specified stage. Append a trailing '+' to run
105 the specified stage and all stages coming after it. With no suf‐
106 fix, stages up to and included the specified stage are run.
107
108 --target
109 Call rpmbuild with a target option. This can be used for cross
110 building.
111
112 --verify
113 Verify the files in an existing build system.
114
115
117 --xen --kvm --uml --qemu --emulator --zvm --lxc
118 Sets a specific vm type.
119
120 --vm-type type
121 As above.
122
123 --vm-disk file
124 Specifies the location of the disk image to use. If this option
125 is not given, buildroot.img is used (e.g. /var/tmp/build-
126 root.img).
127
128 --vm-disk-size size_in_mb
129 Specify the size of the disk image to create.
130
131 --vm-disk-filesystem type
132 Sets the filesystem type to use when creating the disk image.
133 The default is to use the ext3 filesystem.
134
135 --vm-swap file
136 Specifies the location of the swap file to use. If this option
137 is not given, buildroot.swap is used (e.g. /var/tmp/build-
138 root.swap).
139
140 --vm-swap-size size_in_mb
141 Specify the size of the swap file to create.
142
143 --vm-memory size_in_mb
144 Sets the desired memory size of the virtual machine.
145
146 --vm-kernel kernel_file
147 Set a specific kernel to boot in the virtual machine.
148
149 --vm-initrd initrd_file
150 Set a specific kernel to boot in the virtual machine.
151
152 --vm-disk-clean
153 Force the recreation of the disk image.
154
155 --vm-network
156 Enables network inside for VM builds
157
158 --vm-telnet PORT
159 Is forwarding PORT to a telnet session inside of the VM. Spec‐
160 ify also needed extra packages via -x parameter, usually: --vm-
161 telnet 1234 -x telnet-server -x net-tools
162 And connect from the host via: telnet localhost 1234
163 NOTE: The telnet server gets started after all packages got
164 installed.
165
166
167
169 The build command interprets some special control comments in the
170 recipe file:
171
172 # norootforbuild
173 # needsrootforbuild
174 build uses either user root or user abuild in the build system
175 to do the build. For non-SUSE distros as well as since SUSE
176 10.2, the default build user is abuild. For 10.2 and before,
177 the default build user is root. These two flags in the spec
178 file allow to deviate from the defaults and force-set the build
179 user to abuild and root (for # norootforbuild and # needsroot‐
180 forbuild respectively.
181
182 # needsbinariesforbuild
183 provide the binary rpms that have been used to set up the build
184 root in /.build.binaries within the build root.
185
187 BUILD_ROOT
188 The directory where build should install the chrooted build sys‐
189 tem. "/var/tmp/build-root" is used by default. See the --root
190 option.
191
192 BUILD_RPMS
193 This can be used instead of the --rpms option. Deprecated.
194
195 BUILD_RPM_BUILD_STAGE
196 The rpm build stage (a, b, ...). See the --stage option for
197 more information.
198
199
201 rpm(8), dpkg(8), pacman(8), kiwi(8)
202
203 Maximum RPM:
204 http://www.rpm.org/max-rpm/
205
206 cross distribution packaging:
207 http://en.opensuse.org/openSUSE:Build_Service_cross_distribu‐
208 tion_howto
209
210 openSUSE packaging standards and guidelines:
211 http://en.opensuse.org/Portal:Packaging
212
213
214
215 (c) 1997-2021 SUSE LLC BUILD(1)