EAPI=8 RUST_MIN_VER="1.88.0" inherit cargo DESCRIPTION="Metadata-only routing plane for owned and frontier AI compute" HOMEPAGE="https://trunkmasters.com/airouter" SRC_URI="https://distfiles.baldeagleos.com/airouter-0.1.2-r1.tar.zst https://distfiles.baldeagleos.com/llmbridge-0.1.2-20260919.tar.zst" S="${WORKDIR}/airouter" # The archive contains AIRouter, its pinned LLMBridge path dependency, and a # complete Cargo vendor tree. The package must build without /srv/airouter or # network access. LICENSE="MIT" SLOT="0" KEYWORDS="~amd64" RDEPEND=" acct-group/airouter acct-group/airouter-admin acct-group/airouter-framework acct-user/airouter acct-user/airouter-agent dev-db/postgresql >=dev-lang/python-3.10 sys-apps/acl sys-apps/bubblewrap sys-apps/util-linux " BDEPEND=" net-misc/rsync >=dev-lang/rust-1.88.0 " src_unpack() { # Portage on the target profile does not unpack .tar.zst through the # generic helper; extract both immutable source inputs explicitly. tar --zstd -xf "${DISTDIR}/airouter-0.1.2-r1.tar.zst" -C "${WORKDIR}" || die tar --zstd -xf "${DISTDIR}/llmbridge-0.1.2-20260919.tar.zst" -C "${WORKDIR}" || die mv "${WORKDIR}/llmbridge-0.1.2-20260919" "${WORKDIR}/llmbridge" || die } src_compile() { cargo build --offline --release --workspace --locked \ --features "airouter-catalog/skills-tools,airouter-catalog/workspace-tools,\ airouter-catalog/development-tools,airouter-catalog/release-tools,\ airouter-catalog/learning-tools,airouter-catalog/host-tools,\ airouter-catalog/control-tools" || die } src_install() { dosbin target/release/airouterd dosbin target/release/airouter-agentd dosbin target/release/airouterctl dosbin target/release/airouter-catalog dosbin target/release/airouter-host dosbin target/release/airouter-release dosbin target/release/airouter-verify dosbin target/release/airouter-permissions dosbin target/release/airouter-toolsd dobin target/release/airouter-smoke dobin target/release/airouter-tool exeinto /usr/libexec/airouter doexe target/release/enroll-node doexe packaging/scripts/airouter-renew-node-server doexe packaging/scripts/airouter-capability-refresh doexe packaging/scripts/airouter-framework-backup doexe packaging/scripts/airouter-tools-launch doexe target/release/airouter-desktop-worker exeinto /usr/libexec/airouter/catalog doexe target/release/airouter-skills-catalog doexe target/release/airouter-workspace-catalog doexe target/release/airouter-development-catalog doexe target/release/airouter-release-catalog doexe target/release/airouter-learning-catalog doexe target/release/airouter-host-catalog doexe target/release/airouter-control-catalog newexe scripts/airouter-route.py airouter-route insinto /etc/cron.d doins packaging/cron/airouter-server-cert-renew doins packaging/cron/airouter-capability-refresh doins packaging/cron/airouter-framework-backup insinto /etc/airouter doins config/airouter.toml newins config/framework.example.toml framework.toml doins config/tools.example.toml config/tools-client.example.toml newins config/routing.example.json routing.json insinto /etc/airouter-capabilities newins packaging/capabilities.sources.example.json sources.json insinto /etc/airouter/qualification doins packaging/qualification/native-codex-workbench.json diropts -o airouter -g airouter -m 0700 keepdir /etc/airouter/secrets newinitd packaging/openrc/airouterd airouterd newinitd packaging/openrc/airouter-frameworkd airouter-frameworkd newinitd packaging/openrc/airouter-catalog-refresh airouter-catalog-refresh newinitd packaging/openrc/airouter-qualification airouter-qualification newinitd packaging/openrc/airouter-toolsd airouter-toolsd docinto tools dodoc config/tools.example.toml config/tools-client.example.toml crates/airouter-tools/README.md crates/airouter-tools/DESKTOPS.md docinto / dodoc README.md schema/README.md diropts -o airouter -g airouter -m 0750 keepdir /var/lib/airouter keepdir /var/backups/airouter-framework } pkg_postinst() { elog "Create the signing key with: airouterctl generate-signing-key" elog "Apply migrations with the restricted airouter_migrate role before starting airouterd." }