BUILD(1)
BUILD(1) โ the General Commands Manual page, but make it cute ๐
okay so bestie, this is the BUILD(1) manual from the General Commands Manual, and we're about to make package building make sense. no cap, it's giving "reproducible queen" energy the whole way through. โจ
โจ NAME โจ
build โ build packages in a reproducible way.
๐ ๏ธ SYNOPSIS ๐ ๏ธ
build [--clean|--no-init] [--repo dir_or_url] [--repo...] [--root buildroot] [recipefile]
build --help
build --verify
๐ธ DESCRIPTION ๐ธ
build is a tool to build binary packages in a safe and reproducible way. The default is to build in a chroot sandbox, but build also supports building in a virtual machine for better security. ๐
If a recipe file is specified on the command line, build will use this file and all other files in the directory for building the package. If no recipe argument is provided, build will search the current directory for a file. ๐ซถ
The build tool understands the following recipe file types:
specโ a specfile used to generate rpms.src.rpmโ a source rpm, which will be unpacked for the build.kiwiโ a kiwi config file used to generate a kiwi image.dscโ a dsc file used to generate Debian binary packages.PKGBUILDโ a file used to generate Arch Linux binary packages.build.collaxโ a shell script used to generate a Collax binary package.
๐ OPTIONS ๐
--cleanโ remove the build system and reinitialize it from scratch.--checksโ run checks during build (default).--no-checksโ don't run checks during build.--no-initโ skip the build system initialization and start with build immediately.--repo dir_or_urlโ either a directory containing binary packages (optionally with repository metadata), or a url pointing to some remote repository. Multiple--repooptions can be used to create a specific repository layering. Note that packages are searched in the specified repository order, i.e. the first repository containing a package with a specific name wins regardless of the version. As a special form,'zypp://reponame'can be used to specify a system repository.'zypp://'selects all enabled system repositories. This is also the default ifBUILD_RPMSis not set and no--rpmsor--repooption is used.--dist distributionโ set the distribution. If this option is not given,buildtries to guess the distribution by looking at the available packages. The specified distribution can either be a string like"11.2"or"sles9","debian7", or the pathname of the build configuration to use.--root buildrootโ specifies where the build system is set up. Overrides theBUILD_ROOTenvironment variable.--helpโ print a short help text.--norootforbuildโ force building with userabuild. Otherwise,buildsearches the recipe file for a"needsrootforbuild"hint to decide what user to use.--list-stateโ list packages that would be used to create a fresh build root. Does not create the build root or perform a build.--rpms path1:path2:path3...โ wherebuildcan find the packages needed to create the build system. This option overrides theBUILD_RPMSenvironment variable. This option is deprecated, use--repoinstead.--arch arch1:arch2:arch3...โ what architectures to select from the RPMs.buildautomatically sets this to a sensible value for your host if you do not specify this option, so you should almost never need it.
๐ฅ RPM BUILD SPECIFIC OPTIONS ๐ฅ
--stageโ set stage forrpmbuild. Defaults to'a'. Append a trailing'='to only run the specified stage. Append a trailing'+'to run the specified stage and all stages coming after it. With no suffix, stages up to and included the specified stage are run.--targetโ callrpmbuildwith a target option. This can be used for cross building.--verifyโ verify the files in an existing build system.
๐ง VIRTUAL MACHINE SPECIFIC OPTIONS ๐ง
--xen,--kvm,--uml,--qemu,--emulator,--zvm,--lxcโ sets a specific vm type.--vm-type typeโ as above.--vm-disk fileโ specifies the location of the disk image to use. If this option is not given,buildroot.imgis used (e.g./var/tmp/build-root.img).--vm-disk-size size_in_mbโ specify the size of the disk image to create.--vm-disk-filesystem typeโ sets the filesystem type to use when creating the disk image. The default is to use theext3filesystem.--vm-swap fileโ specifies the location of the swap file to use. If this option is not given,buildroot.swapis used (e.g./var/tmp/build-root.swap).--vm-swap-size size_in_mbโ specify the size of the swap file to create.--vm-memory size_in_mbโ sets the desired memory size of the virtual machine.--vm-kernel kernel_fileโ set a specific kernel to boot in the virtual machine.--vm-initrd initrd_fileโ set a specific kernel to boot in the virtual machine.--vm-disk-cleanโ force the recreation of the disk image.--vm-networkโ enables network inside for VM builds.--vm-telnet PORTโ is forwardingPORTto a telnet session inside of the VM. Specify also needed extra packages via the-xparameter, usually:--vm-telnet 1234 -x telnet-server -x net-tools. And connect from the host via:telnet localhost 1234.
NOTE: The telnet server gets started after all packages got installed.
๐ RECIPE FILE OPTIONS ๐
The build command interprets some special control comments in the recipe file:
# norootforbuildand# needsrootforbuildโbuilduses either userrootor userabuildin the build system to do the build. For non-SUSE distros as well as since SUSE 10.2, the default build user isabuild. For 10.2 and before, the default build user isroot. These two flags in the spec file allow to deviate from the defaults and force-set the build user toabuildandroot(for# norootforbuildand# needsrootforbuildrespectively).# needsbinariesforbuildโ provide the binary rpms that have been used to set up the build root in/.build.binarieswithin the build root.
๐ฑ ENVIRONMENT ๐ฑ
BUILD_ROOTโ the directory wherebuildshould install the chrooted build system."/var/tmp/build-root"is used by default. See the--rootoption.BUILD_RPMSโ this can be used instead of the--rpmsoption. Deprecated.BUILD_RPM_BUILD_STAGEโ the rpm build stage (a,b, ...). See the--stageoption for more information.
๐ SEE ALSO ๐
rpm(8),dpkg(8),pacman(8),kiwi(8)- Maximum RPM:
http://www.rpm.org/max-rpm/ - cross distribution packaging:
http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto - openSUSE packaging standards and guidelines:
http://en.opensuse.org/Portal:Packaging
and that's the whole BUILD(1) vibe, bestie โ footer says (c) 1997-2021 SUSE LLC, bye and slay ๐
๐ฆ where this page comes from
- fedora 43: obs-build 20250829-485.5.1.fc43 ยท (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later
- fedora 44: obs-build 20260312-2.1.1.fc44 ยท (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later
- opensuse-leap 16.0: build 20260415-160000.1.1 ยท GPL-2.0-only OR GPL-3.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms