From Linux Man Pages
build - build SuSE Linux RPMs in a chroot environment
SYNOPSIS
build [--clean|--no-init] [--rpms path1:path2:...] [--arch arch1:arch2:...] [--root buildroot] [spec-
file|srcrpm]
build --help
build --verify
DESCRIPTION
build is a tool to build SuSE Linux RPMs in a safe and clean way. build will install a minimal SuSE Linux as
build system into some directory and will chroot to this system to compile the package. This way you don't risk
to corrupt your working system (due to a broken spec file for example), even if the package does not use Build-
Root.
build searches the spec file for a BuildRequires: line; if such a line is found, all the specified rpms are
installed. Otherwise a selection of default packages are used. Note that build doesn't automatically resolve
missing dependencies, so the specified rpms have to be sufficient for the build.
If a spec file is specified on the command line, build will use this file and all other files in the directory
for building the package. If a srcrpm is specified, build automatically unpacks it for the build. If neither is
given, build will use all the specfiles in the current directory.
OPTIONS
--clean
remove the build system and reinitialize it from scratch.
--no-init
skip the build system initialization and start with build immediately.
--list-state
list rpms that would be used to create a fresh build root. Does not create the build root or perform a
build.
--rpms path1:path2:path3...
Where build can find the SuSE Linux RPMs needed to create the build system. This option overrides the
BUILD_RPMS environment variable.
--arch arch1:arch2:arch3...
What architectures to select from the RPMs. build automatically sets this to a sensible value for your
host if you don't specify this option.
--root buildroot
Specifies where the build system is set up. Overrides the BUILD_ROOT enviroment variable.
--useusedforbuild
Tell build not to do dependency expansion, but to extract the list of packages to install from "usedfor-
build" lines or, if none are found, from all "BuildRequires" lines. This option is useful if you want to
re-build a package from a srcrpm with exactly the same packages used for the srcrpm build.
--help Print a short help text.
--verify
verify the files in an existing build system.
ENVIRONMENT
BUILD_ROOT
The directory where build should install the chrooted build system. "/var/tmp/build-root" is used by
default.
BUILD_RPMS
Where build can find the SuSE Linux RPMs. build needs them to create the build system. "/media/dvd/suse"
is the default value which will do the trick if you have the SuSE Linux DVD mounted.
BUILD_RPM_BUILD_STAGE
The rpm build stage (-ba, -bb, ...). This is just passed through to rpm, check the rpm manpage for a com-
plete list and descriptions. "-ba" is the default. You can use this to add more options to RPM.
RELATED
rpm(1),
Maximum RPM:
http://www.rpm.org/max-rpm/
CATEGORY