Files
zeta-toolchain/toolchain/examples/hooks-demo/hooks-demo.recipe
T
2026-08-17 19:23:32 -04:00

27 lines
1.1 KiB
Plaintext

-- hooks-demo.recipe — demonstrates shipping a post-transaction hook.
--
-- The custom build script installs a small command and a hook file under
-- usr/share/zeta/hooks/. zeta-makepkg scans the stage for *.hook files,
-- validates each one (a hook is a pure-data Lua table carrying `trigger`
-- and `action`), and merges the found paths into the generated `files`
-- whitelist so the hook is committed alongside the declared files.
--
-- To try this:
-- 1. Unpack the source tarball: tar -xzf hooks-demo-1.0.tar.gz
-- 2. Run the script manually: cd hooks-demo-1.0 && DESTDIR=/tmp/stage sh build.sh
-- 3. Inspect the staged output: find /tmp/stage
-- 4. Build with makepkg: zeta-makepkg hooks-demo.recipe
return {
name = "hooks-demo",
version = "1.0",
summary = "Example package shipping a post-transaction hook",
url = "hooks-demo-1.0.tar.gz",
sha256 = nil,
deps = {},
build_system = "custom",
build_script = "build.sh",
files = { "usr/bin/hooks-demo", "usr/share/zeta/hooks/hooks-demo.hook" },
test = "test -x ${DESTDIR}/usr/bin/hooks-demo",
}