abuild(1)

πŸ’… abuild β€” aka the manual page for abuild(1), General Commands Manual, bestie ✨

okay so listen. <pink>abuild</pink> builds an apk binary package based on an input APKBUILD(5), and it also does a bunch of other related operations. that's the whole vibe. it's the main character of Alpine packaging fr fr πŸŽ€


✨ SYNOPSIS ✨

abuild [options] [-C DIR] [-P REPODEST] [-s SRCDEST] [-D DESCRIPTION]
[cmd] ...

like, options first, then optionally a command, and if you don't give a command it just does the whole thing (we'll get there, don't worry) 🫢


🌸 DESCRIPTION 🌸

so <purple>abuild</purple> builds an apk binary package based on an input APKBUILD(5), as well as other related operations. that's it, that's the tweet. it's giving "one tool, many jobs", and honestly? iconic πŸ‘‘


✨ OPTIONS ✨

  • -A β€” prints CARCH and then dips. that's it. that's the whole flag πŸ’…
  • -c β€” turn on colored output 🌈
  • -C DIR β€” change directory to DIR before running any commands. very "we're going to a different folder, come on" energy
  • -d β€” disable dependency checking. no cap, just skip it πŸ™ˆ
  • -D DESCRIPTION β€” set the APKINDEX description (default: $repo $(git describe)). yes the default literally runs git describe, slay
  • -f β€” force the specified cmd, which means skipping the checks: apk up to date, arch. you're overriding the vibe check, be careful πŸ’€
  • -F β€” force run as root πŸ‘‘
  • -h β€” show this help. hi bestie, here's the help 🫢
  • -k β€” keep built packages, even if APKBUILD or sources are newer. so stubborn, love that for you
  • -K β€” keep buildtime temp dirs and files (srcdir/pkgdir/deps). hoarder mode, valid
  • -m β€” disable colors, aka monochrome mode. sad beige terminal πŸ₯²
  • -P REPODEST β€” set REPODEST as the repository location for created packages
  • -q β€” quiet 🀫
  • -r β€” install missing dependencies from the system repository
  • -s SRCDEST β€” set the source package destination directory to SRCDEST
  • -v β€” verbose: show every command as it is run. the manpage itself calls this very noisy, and it's so right 😭

πŸ¦‹ COMMANDS πŸ¦‹

  • all β€” runs the entire build process. this is the default when no other command is specified, and is roughly an alias for validate builddeps clean fetch unpack prepare mkusers build check rootpkg. the whole pipeline, the full main character arc ⭐
  • build β€” compile and install package into $pkgdir
  • check β€” run any defined tests concerning the package πŸ§ͺ
  • checksum β€” generate checksum to be included in APKBUILD
  • clean β€” remove temp build and install dirs 🧹
  • cleancache β€” remove downloaded files from $SRCDEST
  • cleanoldpkg β€” remove binary packages except current version
  • cleanpkg β€” remove already built binary and source package
  • deps β€” install packages listed in makedepends and depends
  • fetch β€” fetch sources to $SRCDEST
  • index β€” regenerate indexes in $REPODEST
  • listpkg β€” list target packages πŸ“‹
  • package β€” install project into
  • prepare β€” apply patches 🩹
  • rootbld β€” build package in clean chroot. requires abuild-rootbld
  • rootpkg β€” run 'package', the split functions and create apks as fakeroot
  • validate β€” basic validation of APKBUILD βœ…
  • snapshot β€” create a $giturl snapshot and upload to $disturl πŸ“Έ
  • sourcecheck β€” check if remote source package exists upstream
  • srcpkg β€” make a source package
  • undeps β€” uninstall packages listed in makedepends and depends
  • unpack β€” unpack sources to $srcdir
  • up2date β€” compare target and sources dates

🌈 ENVIRONMENT 🌈

  • APKBUILD β€” override path to APKBUILD file
  • BOOTSTRAP β€” used when bootstrapping with no existing packages by minimising build dependencies. this flag only has an effect on a few select packages.
    • a value of nocc omits any compilation (e.g.: include only source headers).
    • a value of nolibc assumes that no libc is available.
    • this list of values is not exhaustive πŸ‘€
  • CHOST β€” generate packages for given arch or triplet
  • CTARGET β€” generate compiler for given arch or triplet
  • PACKAGER β€” name and email of the packages in RFC5322 format. e.g.: John Doe <john@example.com>
  • PACKAGER_PRIVKEY β€” path to a private key used to sign packages πŸ”‘
  • REPODEST β€” packages shall be stored in $REPODEST/$repo/$arch/$pkgname-$pkgver-r$pkgrel.apk, where $repo is the base name of the parent directory of $startdir
  • SOURCE_DATE_EPOCH β€” use this timestamp as a reference for reproducible builds. see https://reproducible-builds.org/docs/source-date-epoch/
  • SUDO_APK β€” command to use to run apk as root. defaults to abuild-apk
  • USE_CCACHE β€” if set to a non-empty value, enables ccache support
  • USE_COLORS β€” if set to a non-empty value, print coloured output using ANSI escape sequences 🌸
ngl the "non-empty value" thing is doing a lot of work here β€” it's not "true", it's not "1", it's literally just "anything that isn't empty". iykyk πŸ’…

πŸŽ€ FILES πŸŽ€

  • /etc/abuild.conf β€” configuration is read from this file by default
  • $HOME/.abuild/abuild.conf β€” user-specific configuration is read from this file, if it exists

πŸ’– EXAMPLES πŸ’–

update checksums for an APKBUILD:

abuild checksum

build an APKBUILD and print coloured output:

abuild -rc

see how -r and -c just smoosh together like that? obsessed 🫢


πŸ‘€ SEE ALSO πŸ‘€

SPDX license reference (on the Web at <https://spdx.org/licenses/>), newapkbuild(1), apk(8), APKBUILD(5), abuild.conf(5), buildrepo(1), ap(1), checkapk(1).


🌟 AUTHORS 🌟

  • abuild: Natanael Copa <ncopa@alpinelinux.org>
  • Documentation: Hugo Osvaldo Barrera <hugo@whynothugo.nl>

that's the page!! this version of the abuild(1) manpage from the General Commands Manual is dated <yellow>2026-06-05</yellow>, and yeah the footer just says abuild(1) again because manpages love a little symmetry πŸ’œ go build something cute, bestie, and remember: validate before you ship, periodt 🧚

πŸ“¦ where this page comes from