#!/bin/bash # Build aish__all.deb from this directory using dpkg-deb directly. # Run from inside the runner container, which has dpkg installed. # # Matches the lmcp build-deb.sh pattern: no dh/debhelper, no Build-Depends # beyond `dpkg`, structurally a normal apt package (Architecture: all). set -euo pipefail PKGVER=0.1.0 UPSTREAM_TAG=v0.1.0 PKGREL=1 AISH_TARBALL_SHA256=9ebc3939e028832e39391ae33efacb5ec9bcd99d123cbc8ca1cd6ca9a640b5b5 HERE=$(dirname "$(readlink -f "$0")") # Reproducible build: pin all file mtimes + ar member timestamps to a fixed # epoch tied to this packaging release (aish v0.1.0 — 2026-05-25 00:00 UTC). # Without this, repeat builds produce different byte streams and reprepro # refuses re-includes with "size expected: X, got: Y". export SOURCE_DATE_EPOCH=1779667200 work=$(mktemp -d) trap "rm -rf $work" EXIT cd "$work" curl --connect-timeout 10 --max-time 600 --retry 3 --retry-delay 5 -sSLfo aish.tar.gz \ "https://git.reauktion.de/marfrit/aish/archive/${UPSTREAM_TAG}.tar.gz" echo "$AISH_TARBALL_SHA256 aish.tar.gz" | sha256sum -c tar xzf aish.tar.gz ROOT="$work/pkgroot" LIBDIR="$ROOT/usr/share/lua/5.1/aish" mkdir -p "$ROOT/DEBIAN" \ "$LIBDIR/ffi" \ "$LIBDIR/vendor" \ "$ROOT/usr/bin" \ "$ROOT/usr/share/doc/aish/examples" # Top-level modules for m in main broker context executor history mcp renderer repl router safety secrets; do cp "aish/${m}.lua" "$LIBDIR/${m}.lua" done # FFI bindings for m in curl libc pty readline; do cp "aish/ffi/${m}.lua" "$LIBDIR/ffi/${m}.lua" done # Vendored dependencies cp aish/vendor/dkjson.lua "$LIBDIR/vendor/dkjson.lua" # Launch wrapper install -m 755 aish/bin/aish "$ROOT/usr/bin/aish" # Documentation + example config cp aish/README.md "$ROOT/usr/share/doc/aish/" cp aish/LICENSE "$ROOT/usr/share/doc/aish/" cp aish/examples/config.lua "$ROOT/usr/share/doc/aish/examples/" cp "$HERE/debian/copyright" "$ROOT/usr/share/doc/aish/copyright" cp "$HERE/debian/changelog" "$ROOT/usr/share/doc/aish/changelog.Debian" gzip -9 -n "$ROOT/usr/share/doc/aish/changelog.Debian" cat > "$ROOT/DEBIAN/control" < Homepage: https://git.reauktion.de/marfrit/aish Description: AI-augmented conversational shell (LuaJIT, FFI-only) aish is an interactive REPL that interleaves shell execution and language-model conversation against llama.cpp HTTP brokers. Pure LuaJIT 2.x with FFI bindings to libcurl, GNU readline, and libc. . Modules install under /usr/share/lua/5.1/aish/. The launcher is /usr/bin/aish. Example configuration is at /usr/share/doc/aish/examples/config.lua (copy to ~/.config/aish/config.lua and adapt). EOF # Build the .deb. Output to current dir of the caller. DEB_OUT=aish_${PKGVER}-${PKGREL}_all.deb dpkg-deb --root-owner-group --build "$ROOT" "$HERE/$DEB_OUT" echo "built: $HERE/$DEB_OUT"