1 .de TQ \"follow a TP item with several TQ items to define several
2 . \"entities with one shared description.
7 .TH build 1 "(c) 1997-2008 SuSE Linux AG Nuernberg, Germany"
9 build \- build SuSE Linux RPMs in a chroot environment
12 .RB [ --clean | --no-init]
26 \fBbuild\fR is a tool to build binary packages in a safe and reproducible
28 The default is to build in a chroot sandbox, but \fBbuild\fP also supports
29 building in a virtual machine for better security.
31 If a recipe file is specified on the command line,
33 will use this file and all other files in the directory for building
34 the package. If no recipe argument is provided, build will search the
35 current directory for a file.
39 tool understands the following recipe file types:
42 A specfile used to generate rpms.
45 A source rpm, which will be unpacked for the build.
48 A kiwi config file used to generate a kiwi image.
51 A dsc file used to generate Debian binary packages.
54 A file used to generate Arch Linux binary packages.
57 A shell script used to generate a Collax binary package.
62 Remove the build system and reinitialize it from scratch.
65 Skip the build system initialization and start with build immediately.
67 .BI "\-\-repo " dir_or_url
68 Either a directory containing binary packages (optionally with repository
69 metadata), or a url pointing to some remote repository. Multiple
70 \fB--repo\fP options can be used so create a specific repository
71 layering. Note that packages are searched in the specified repository
72 order, i.e. the first repository containing a package with a specific
73 name wins regardless of the version.
74 As a special form, 'zypp://reponame' can be used to specify
75 a system repository. 'zypp://' selects all enabled system
76 repositories. This is also the default if BUILD_RPMS is not
77 set and no \fB--rpms\fP or \fB--repo\fP option is used.
79 .BI "\-\-dist " distribution
80 Set the distribution. If this option is not given, build tries to
81 guess the distribution by looking at the available packages.
82 The specified distribution can either be a string
83 like "11.2" or "sles9", "debian7", or the pathname of the build
86 .BI "\-\-root " buildroot
87 Specifies where the build system is set up. Overrides the
88 BUILD_ROOT enviroment variable.
91 Print a short help text.
94 Force building with user \fRabuild\fP. Otherwise, \fBbuild\fP searches
95 the recipe file for a "needsrootforbuild" hint to decide what user
99 list packages that would be used to create a fresh build root.
100 Does not create the build root or perform a build.
102 .BI "\-\-rpms " path1 : path2 : path3\fR...\fP
103 Where build can find the packages needed to create the
104 build system. This option overrides the BUILD_RPMS environment
105 variable. This option is deprecated, use \fB--repo\fP instead.
107 .BI "\-\-arch " arch1 : arch2 : arch3\fR...\fP
108 What architectures to select from the RPMs.
110 automatically sets this to a sensible value for your host if you
111 do not specify this option so you should almost never need it.
113 .SH RPM BUILD SPECIFIC OPTIONS
116 Tell build not to do dependency expansion, but to extract the
117 list of packages to install from "# usedforbuild" lines or, if none
118 are found, from all "BuildRequires" lines. This option is useful
119 if you want to re-build a package from a srcrpm with exactly the
120 same packages used for the srcrpm build.
123 Pass a stage option to rpmbuild. The default is \fB-ba\fP.
126 Call rpmbuild with a target option. This can be used for cross building.
129 Verify the files in an existing build system.
131 .SH VIRTUAL MACHINE SPECIFIC OPTIONS
133 .B "--xen --kvm --uml --qemu --emulator --zvm --lxc"
134 Sets a specific vm type.
136 .BI "--vm-type " type
139 .BI "--vm-disk " file
140 Specifies the location of the disk image to use. If this option is not
141 given, \fIbuildroot\fP\fB.img\fP is used (e.g. /var/tmp/build-root.img).
143 .BI "--vm-disk-size " size_in_mb
144 Specify the size of the disk image to create.
146 .BI "--vm-disk-filesystem " type
147 Sets the filesystem type to use when creating the disk image. The default
148 is to use the ext3 filesystem.
150 .BI "--vm-swap " file
151 Specifies the location of the swap file to use. If this option is not
152 given, \fIbuildroot\fP\fB.swap\fP is used (e.g. /var/tmp/build-root.swap).
154 .BI "--vm-swap-size " size_in_mb
155 Specify the size of the swap file to create.
157 .BI "--vm-memory " size_in_mb
158 Sets the desired memory size of the virtual machine.
160 .BI "--vm-kernel " kernel_file
161 Set a specific kernel to boot in the virtual machine.
163 .BI "--vm-initrd " initrd_file
164 Set a specific kernel to boot in the virtual machine.
167 Force the recreation of the disk image.
169 .B "--vm-telnet" PORT
170 Is forwarding PORT to a telnet session inside of the VM.
171 Specify also needed extra packages via -x parameter, usually:
172 .I --vm-telnet 1234 -x telnet-server -x net-tools
173 And connect from the host via:
174 .I telnet localhost 1234
175 NOTE: The telnet server gets started after all packages got installed.
178 .SH RECIPE FILE OPTIONS
181 command interprets some special control comments in the recipe file:
185 .B # needsrootforbuild
191 in the build system to do the build. For non-SUSE distros as well as
192 since SUSE 10.2, the default build user is
194 For 10.2 and before, the default build user is
196 These two flags in the spec file allow to deviate from the defaults
197 and force-set the build user to
201 .RI "(for " "#\ norootforbuild" " and " "#\ needsrootforbuild" " respectively."
203 .B # needsbinariesforbuild
204 provide the binary rpms that have been used to set up the build root
207 within the build root.
211 The directory where build should install the chrooted build system.
212 "/var/tmp/build-root" is used by default. See the \fB--root\fP option.
215 This can be used instead of the \fB--rpms\fP option. Deprecated.
217 .B BUILD_RPM_BUILD_STAGE
218 The rpm build stage (-ba, -bb, ...). This is just passed through to
219 rpm, check the rpm manpage for a complete list and descriptions.
220 "-ba" is the default. You should probably use the \fB--stage\fP
224 .BR rpm (8), dpkg (8), pacman (8), kiwi (8)
227 .I http://www.rpm.org/max-rpm/
229 .BR "cross distribution packaging":
230 .I http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
232 .BR "openSUSE packaging standards and guidelines":
233 .I http://en.opensuse.org/Portal:Packaging