# Same-named CLI exists in Fedora rawhide; -bin reserves the plain name Name: openclaw-bin Version: 2026.10.4 Release: 1%{?dist} Summary: OpenClaw CLI, a personal AI assistant (npm bundle) License: MIT URL: https://github.com/openclaw/openclaw Source0: https://registry.npmjs.org/openclaw/-/openclaw-%{version}.tgz BuildArch: noarch Provides: openclaw = %{version}-%{release} Conflicts: openclaw Requires: nodejs24 BuildRequires: nodejs24 BuildRequires: nodejs24-npm # The npm tarball bundles only some deps (@openclaw/ai and @openclaw/fs-safe are # missing); the rest must be installed from the registry at build time. # --legacy-peer-deps: @mistralai/mistralai pins a conflicting peerOptional. # --omit=optional: fs-safe's optional native addon is arch-specific and this is # noarch; fs-safe falls back to plain fs calls without it. # env-node shebangs across node_modules would be mangled to a nonexistent # /usr/bin/node (only node-24 exists), so skip that BRP. %define __brp_mangle_shebangs %{nil} %description OpenClaw is a personal AI assistant you run on your own devices: one agent, persistent memory, and the channels you already use. This package ships the official npm bundle with the openclaw CLI. %prep %autosetup -n package %build export npm_config_cache=%{_builddir}/.npm %{_bindir}/npm-24 install --omit=dev --omit=optional --ignore-scripts \ --no-audit --no-fund --legacy-peer-deps # First run completes the npm postinstall lifecycle (.openclaw-lifecycle-pending # marker) inside the built tree so users never trigger it; with the native mode # off it cannot re-install the arch-specific fs-safe addon. HOME=%{_builddir} OPENCLAW_FS_SAFE_NATIVE_MODE=off \ %{_bindir}/node-24 ./openclaw.mjs --version %install install -d -m755 %{buildroot}%{_prefix}/lib/node_modules/openclaw cp -a . %{buildroot}%{_prefix}/lib/node_modules/openclaw/ install -Dpm755 /dev/null %{buildroot}%{_bindir}/openclaw cat > %{buildroot}%{_bindir}/openclaw <<'EOF' #!/bin/sh exec /usr/bin/node-24 %{_prefix}/lib/node_modules/openclaw/openclaw.mjs "$@" EOF %check # Invoke node-24 directly against the buildroot tree: the wrapper hardcodes # the final installed path, which does not exist during the build. HOME=%{_builddir} OPENCLAW_FS_SAFE_NATIVE_MODE=off \ %{_bindir}/node-24 \ %{buildroot}%{_prefix}/lib/node_modules/openclaw/openclaw.mjs --version %files %license LICENSE %doc README.md %{_bindir}/openclaw %{_prefix}/lib/node_modules/openclaw/ %changelog * Sat Oct 17 2026 Caio Bruno - 2026.10.4-1 - Initial package