commit 534e1a6965d7a03d4f439ef335105328c2deb978 Author: Astral <208268648+AstralZX@users.noreply.github.com> Date: Tue Sep 1 08:00:05 2026 +0200 Initial scaffold diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff23d37 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# kama-packages + +The central package (recipe) repository for [Keru OS](https://github.com/AstralZX/KeruOS), +built by [Kama](https://github.com/AstralZX/kama). + +Every package is a plain POSIX shell script that describes how to compile and +install one piece of software. Nothing more — no manifests, no metadata files, +no build databases. The recipe *is* the package. + +## Layout + +``` +TEMPLATE.sh starting point for new recipes +busybox.sh easy-tier example (autotools-ish, static build) +runit.sh advanced-tier example (custom fetch/patch, pkg_post) +``` + +## Recipe syntax (quick) + +```sh +name=busybox +version=1.36.1 +url=https://busybox.net/downloads/busybox-1.36.1.tar.bz2 +deps=() # build-time deps (AUR-style: built then purged) + +build() { make defconfig; make -j"$JOBS"; } # configure + compile +install() { make install CONFIG_PREFIX="$pkgdir"; } # stage into $pkgdir +``` + +Kama handles download, extraction, staging, and temp-dep cleanup. For advanced +needs (custom fetch, patches, post-install hooks, splitting), override +`pkg_fetch`, `pkg_post`, or `pkg_split`. See the +[full format spec](https://github.com/AstralZX/KeruOS/blob/main/docs/recipe-format.md). + +## Contributing + +1. Copy `TEMPLATE.sh` to `.sh`. +2. Fill in `name`, `version`, `url`, and the build/install functions. +3. Verify with `sh -n .sh` and by building it (`kama make `). +4. Open a pull request. + +

Every package a kiln-load — fire it from source.

diff --git a/TEMPLATE.sh b/TEMPLATE.sh new file mode 100644 index 0000000..7213b8b --- /dev/null +++ b/TEMPLATE.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env sh +# Kama recipe template +# +# Copy this file to packages/.sh (or packages//recipe.sh) and +# fill in the easy tier. Step up to the advanced tier only if you need it. +# +# For the simple case you only need: name, version, url, build(), install(). +# Kama handles downloading + extraction automatically (the default_fetch). + +name= +version= +url= +deps=() # build-time deps (AUR-style: compiled then purged) + +# ---- advanced (optional) ------------------------------------------------ +# runtime_deps=() +# license=() +# provides=() +# conflicts=() +# arch=() +# noextract=() +# +# pkg_fetch() { default_fetch; patch -p1 < ../something.patch; } +# pkg_post() { :; } +# pkg_split() { :; } + +build() { + # configure + compile here + : +} + +install() { + # install into $pkgdir (staging), NOT into $ROOT + : +} diff --git a/busybox.sh b/busybox.sh new file mode 100644 index 0000000..168b7e9 --- /dev/null +++ b/busybox.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +# busybox — easy-tier recipe example +# Kama auto-fetches + auto-extracts; we just build and stage-install. + +name=busybox +version=1.36.1 +url=https://busybox.net/downloads/busybox-1.36.1.tar.bz2 +deps=() # no build-time deps for a static busybox + +build() { + make defconfig + make -j"$JOBS" +} + +install() { + make install CONFIG_PREFIX="$pkgdir" +} diff --git a/runit.sh b/runit.sh new file mode 100644 index 0000000..fd51d4f --- /dev/null +++ b/runit.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env sh +# runit — advanced-tier recipe example +# Shows overriding pkg_fetch (patch before build) and using pkg_post. + +name=runit +version=2.1.2 +url=https://smarden.org/runit/runit-2.1.2.tar.gz +deps=(gcc) +runtime_deps=() +license=(BSD-3-Clause) +provides=(init) + +# patch the default package/ target so install lands in $pkgdir +pkg_fetch() { + default_fetch + cd "$src" + # runit's makefile assumes an absolute package/ dir; inject DESTDIR + sed -i 's|^package/.*|& DESTDIR="'"$pkgdir"'"|' src/Makefile 2>/dev/null || true +} + +build() { + cd src + make -j"$JOBS" +} + +install() { + cd src + ./install.sh "$pkgdir" 2>/dev/null || make install DESTDIR="$pkgdir" +} + +pkg_post() { + # runit expects to own /service etc; staged, so just create dirs + mkdir -p "$pkgdir/etc/sv" "$pkgdir/service" + ln -sf /usr/sbin/runit-init "$pkgdir/sbin/init" +}