home / kama / recipes

Kama recipes

The package manager runs recipes. Here's what a recipe is.

A Kama recipe is a plain shell script. It declares metadata and defines build steps. There is no DSL to learn beyond shell itself — which is the point. The recipe repository (kama-packages) contains one file per package, and each one is readable top to bottom.

Anatomy of a recipe

name=busybox version=1.36.1 url="https://busybox.net/downloads/busybox-${version}.tar.bz2" deps=( make ) build() { cp ../config .config # basic setup from kama make -j"$(nproc)" } install() { make install CONFIG_PREFIX="$DESTDIR" }

The key fields:

FieldMeaning
namePackage name; used for the stage and cache paths.
versionThe release version, typically embedded in the url.
urlUpstream source tarball (mirror-then-upstream on fetch).
depsArray of build-time dependencies, built then purged.
build()Runs in the extracted source dir — configure & compile.
install()Installs into the package's stage dir (DESTDIR).

Two tiers

Recipes can stay deliberately simple or take full control:

  • Easy tier — the build() / install() sugar above. Great for "configure, make, make install" packages.
  • Advanced tier — pkg_build(), pkg_install(), custom pkg_fetch(), and a pkg_post() hook. For packages that need a hand.

Kama maps the easy tier onto the advanced one when the advanced forms aren't defined, so simple recipes stay simple and complex ones stay powerful.

The staging model

Building installs into a per-package stage dir, not the live root. That's how kama can assemble a complete system in $ROOT — the installer's whole trick — without ever touching the tree being built. The install step copies the staged dir into $ROOT.

How it's found

Kama locates a recipe by trying PKGDIR/<pkg>/PKGBUILD, then PKGDIR/<pkg>.sh, then PKGDIR/<pkg>/*.sh. Naming a recipe file <pkg>.sh is the common case.

A recipe is a contract you can read. No opaque package format, no hidden build logic — if you can read shell, you can audit every package in the repository.

The formal recipe format spec · ← Kama overview