1BUILD(1) General Commands Manual BUILD(1)
2
3
4
6 build - build SUSE Linux RPMs in a chroot environment
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
100 exactly the same packages used for the srcrpm build.
101
102 --stage
103 Pass a stage option to rpmbuild. The default is -ba.
104
105 --target
106 Call rpmbuild with a target option. This can be used for cross
107 building.
108
109 --verify
110 Verify the files in an existing build system.
111
112
114 --xen --kvm --uml --qemu --emulator --zvm --lxc
115 Sets a specific vm type.
116
117 --vm-type type
118 As above.
119
120 --vm-disk file
121 Specifies the location of the disk image to use. If this option
122 is not given, buildroot.img is used (e.g. /var/tmp/build-
123 root.img).
124
125 --vm-disk-size size_in_mb
126 Specify the size of the disk image to create.
127
128 --vm-disk-filesystem type
129 Sets the filesystem type to use when creating the disk image.
130 The default is to use the ext3 filesystem.
131
132 --vm-swap file
133 Specifies the location of the swap file to use. If this option
134 is not given, buildroot.swap is used (e.g. /var/tmp/build-
135 root.swap).
136
137 --vm-swap-size size_in_mb
138 Specify the size of the swap file to create.
139
140 --vm-memory size_in_mb
141 Sets the desired memory size of the virtual machine.
142
143 --vm-kernel kernel_file
144 Set a specific kernel to boot in the virtual machine.
145
146 --vm-initrd initrd_file
147 Set a specific kernel to boot in the virtual machine.
148
149 --vm-disk-clean
150 Force the recreation of the disk image.
151
152 --vm-telnet PORT
153 Is forwarding PORT to a telnet session inside of the VM. Spec‐
154 ify also needed extra packages via -x parameter, usually: --vm-
155 telnet 1234 -x telnet-server -x net-tools
156 And connect from the host via: telnet localhost 1234
157 NOTE: The telnet server gets started after all packages got
158 installed.
159
160
161
163 The build command interprets some special control comments in the
164 recipe file:
165
166 # norootforbuild
167 # needsrootforbuild
168 build uses either user root or user abuild in the build system
169 to do the build. For non-SUSE distros as well as since SUSE
170 10.2, the default build user is abuild. For 10.2 and before,
171 the default build user is root. These two flags in the spec
172 file allow to deviate from the defaults and force-set the build
173 user to abuild and root (for # norootforbuild and # needsroot‐
174 forbuild respectively.
175
176 # needsbinariesforbuild
177 provide the binary rpms that have been used to set up the build
178 root in /.build.binaries within the build root.
179
181 BUILD_ROOT
182 The directory where build should install the chrooted build sys‐
183 tem. "/var/tmp/build-root" is used by default. See the --root
184 option.
185
186 BUILD_RPMS
187 This can be used instead of the --rpms option. Deprecated.
188
189 BUILD_RPM_BUILD_STAGE
190 The rpm build stage (-ba, -bb, ...). This is just passed
191 through to rpm, check the rpm manpage for a complete list and
192 descriptions. "-ba" is the default. You should probably use the
193 --stage option instead.
194
195
197 rpm(8),dpkg(8),pacman(8),kiwi(8)
198
199 Maximum RPM:
200 http://www.rpm.org/max-rpm/
201
202 cross distribution packaging:
203 http://en.opensuse.org/openSUSE:Build_Service_cross_distribu‐
204 tion_howto
205
206 openSUSE packaging standards and guidelines:
207 http://en.opensuse.org/Portal:Packaging
208
209
210
211 (c) 1997-2018 SUSE Linux AG Nuernberg, Germany BUILD(1)