# openclaw/rea-agents packaging family (npm tarball + /usr/lib layout, deps # installed at build time over the enabled-net project). Fedora ships # pi-coding-agent only in F45+/rawhide: this copy is newer and covers older # stable + EPEL chroots. Archful: pi-tui ships prebuilt Linux ELF prebuilds # for X11 clipboard access (Fedora drops them to stay noarch; we keep them). %global debug_package %{nil} %global _missing_build_ids_terminate_build 0 Name: pi-coding-agent Version: 1.7.0 Release: 1%{?dist} Summary: Minimal, extensible coding agent CLI (npm bundle) License: MIT URL: https://github.com/earendil-works/pi Source0: https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-%{version}.tgz # no license text ships in the npm tarball; MIT is declared in package.json # and in the repository root ExclusiveArch: x86_64 aarch64 BuildRequires: nodejs24 BuildRequires: nodejs24-npm # pi hard-exits on Node below its engines floor; the check section re-derives # the floor from package.json, this macro is only the Requires fallback %global node_floor 22.19.0 Requires: nodejs24 >= 1:%{node_floor} # Fedora nodejs is built small-icu: Intl.Segmenter().segment() derefs a null # BreakIterator without the full-i18n data and kills the process (SIGSEGV, # nodejs/node#51752, earendil-works/pi#6359) — pi's TUI calls it on the first # render, so the ICU data is not optional Requires: nodejs24-full-i18n BuildRequires: nodejs24-full-i18n # pi probes PATH (fd, fdfind, rg) before downloading user-level copies of # fd/ripgrep into its own dir; the distro packages make that probe always # succeed, so the user-level downloader never runs Requires: fd-find Requires: ripgrep # pi shells out to plain npm for its package install/update flows; the # unversioned binary belongs to whichever nodejs major is default on the # release (nodejs-npm on F43/EPEL, the -npm-bin family from F44), so # require the file and let rpm resolve the provider per release Requires: /usr/bin/npm # env-node shebangs across the npm payload; the wrapper is the entrypoint %global __brp_mangle_shebangs %{nil} %description Pi is a minimal terminal coding harness: a unified multi-provider LLM API, an agent loop with tool calling, and an interactive TUI with read, bash, edit and write tools plus session management. Extend it with TypeScript extensions, skills, prompt templates and themes. This package ships the official npm bundle with the pi CLI. %prep %autosetup -n package # SDK example code (doom wasm port, tweetnacl demos), not runtime payload rm -rf examples %build # The npm tarball is not self-contained; remaining deps install at build time export npm_config_cache=%{_builddir}/.npm %{_bindir}/npm-24 install --omit=dev --ignore-scripts --no-audit --no-fund # pi-tui ships per-platform native prebuilds for clipboard access; keep only # the Linux one matching the build arch, drop everything else rm -rf node_modules/@earendil-works/pi-tui/native/darwin \ node_modules/@earendil-works/pi-tui/native/win32 %ifarch x86_64 rm -rf node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64 %endif %ifarch aarch64 rm -rf node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64 %endif %install install -d -m755 %{buildroot}%{_prefix}/lib/node_modules/%{name} cp -a . %{buildroot}%{_prefix}/lib/node_modules/%{name}/ install -Dpm755 /dev/null %{buildroot}%{_bindir}/pi cat > %{buildroot}%{_bindir}/pi <<'EOF' #!/bin/sh exec /usr/bin/node-24 /usr/lib/node_modules/pi-coding-agent/dist/bundle/cli.js "$@" EOF %check # probe the small-icu Segmenter crash (see the full-i18n Requires above) so # a future nodejs change re-breaks this build instead of the user's terminal HOME=%{_builddir} %{_bindir}/node-24 -e \ 'new Intl.Segmenter("en", {granularity: "grapheme"}).segment("hello world")' # pi hard-exits on Node below its engines floor, which can be newer than # the distro nodejs24 (updates lag updates-testing); smoke-run only where # the buildroot nodejs24 meets the floor. The floor comes from the # package.json engines field (survives version bumps without spec edits), # falling back to the node_floor macro. runtime=$(rpm -q --qf '%%{version}' nodejs24) floor=$(sed -n 's/.*"nod[e]": *">=\([^"]*\)".*/\1/p' package.json | head -1) floor=${floor:-%{node_floor}} if [ "$(printf '%%s\n%%s\n' "$floor" "$runtime" | sort -V | tail -1)" = "$runtime" ]; then HOME=%{_builddir} %{_bindir}/node-24 \ %{buildroot}%{_prefix}/lib/node_modules/%{name}/dist/bundle/cli.js --version HOME=%{_builddir} %{_bindir}/node-24 \ %{buildroot}%{_prefix}/lib/node_modules/%{name}/dist/bundle/cli.js --help >/dev/null else echo "distro nodejs24 $runtime below pi's $floor floor; skipping smoke run" fi %files %doc README.md CHANGELOG.md %{_bindir}/pi %{_prefix}/lib/node_modules/%{name}/ %changelog * Sun Nov 29 2026 Caio Bruno - 1.7.0-1 - Initial package