Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

Add Fedora RPM packaging

Simão Moreira591bb90d484c
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d666440..c81e6f03 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -193,6 +193,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - run: sudo apt-get update && sudo apt-get install -y rpm
- run: scripts/check-native-packaging.sh
- run: tests/wrapper_upgrade.sh
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f55278be..0f1f0234 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -488,7 +488,7 @@ jobs:
github-release:
name: github release
- needs: [binary, macos, windows, validate-version]
+ needs: [binary, macos, windows, rpm, validate-version]
runs-on: ubuntu-latest
permissions:
contents: write
@@ -538,6 +538,8 @@ jobs:
echo "yay -S ai-memory-bin # prebuilt Linux x86_64/aarch64 binary" >> body.md
echo "yay -S ai-memory # builds from source" >> body.md
echo "" >> body.md
+ echo "# Fedora: download the matching RPM below, then run sudo dnf install ./ai-memory-<version>-1.<arch>.rpm" >> body.md
+ echo "" >> body.md
echo "# Docker" >> body.md
echo "docker pull akitaonrails/ai-memory:${{ needs.validate-version.outputs.version }}" >> body.md
echo "" >> body.md
@@ -666,3 +668,51 @@ jobs:
publish_pkg ai-memory "$source_pkgbuild"
publish_pkg ai-memory-bin "$bin_pkgbuild"
EOF
+
+ rpm:
+ name: Fedora RPM (${{ matrix.arch }})
+ needs: [binary, validate-version]
+ runs-on: ${{ matrix.runner }}
+ strategy:
+ matrix:
+ include:
+ - arch: x86_64
+ runner: ubuntu-24.04
+ - arch: aarch64
+ runner: ubuntu-24.04-arm
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: ai-memory-linux-${{ matrix.arch }}
+ path: artifacts
+
+ - name: Build RPM
+ env:
+ VERSION: ${{ needs.validate-version.outputs.version }}
+ ARCH: ${{ matrix.arch }}
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cpio rpm
+ mkdir -p "$HOME/rpmbuild/SOURCES" "$HOME/rpmbuild/SPECS" "$HOME/rpmbuild/RPMS"
+ cp artifacts/ai-memory-linux-${ARCH}.tar.gz "$HOME/rpmbuild/SOURCES/"
+ cp packaging/rpm/ai-memory.spec "$HOME/rpmbuild/SPECS/"
+ sed -i "s/^Version: .*/Version: ${VERSION}/" "$HOME/rpmbuild/SPECS/ai-memory.spec"
+ rpmbuild -bb "$HOME/rpmbuild/SPECS/ai-memory.spec"
+ rpm_file="$(find "$HOME/rpmbuild/RPMS" -name '*.rpm' -print -quit)"
+ test -n "$rpm_file"
+ rpm -qp --queryformat '%{VERSION} %{ARCH}\n' "$rpm_file" | grep -Fx "$VERSION $ARCH"
+ rpm -ql "$rpm_file" | grep -Fx /usr/lib/systemd/system/ai-memory.service
+ root="$(mktemp -d)"
+ trap 'rm -rf "$root"' EXIT
+ rpm2cpio "$rpm_file" | (cd "$root" && cpio -idm --quiet)
+ "$root/usr/bin/ai-memory" --version | grep -Fx "ai-memory $VERSION"
+ rpm_name="ai-memory-$(rpm -qp --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}' "$rpm_file").rpm"
+ mv "$rpm_file" "artifacts/$rpm_name"
+ (cd artifacts && sha256sum "$rpm_name" > "$rpm_name.sha256")
+
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: ai-memory-rpm-${{ matrix.arch }}
+ path: artifacts/*.rpm*
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 188df552..07ade2bc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added
+- Fedora users can install prebuilt x86_64 and aarch64 RPMs from GitHub
+ Releases, with the existing native systemd service assets. (#NNN)
+
### Fixed
- `companions/ai-memory-macos/build.sh` no longer fails on machines whose
active developer directory is Command Line Tools only: SwiftUI `@State`
diff --git a/README.md b/README.md
index 7805a6bd..7c758b63 100644
--- a/README.md
+++ b/README.md
@@ -194,6 +194,18 @@ yay -S ai-memory-bin # prebuilt Linux x86_64/aarch64 binary
yay -S ai-memory # builds from source
```
+### Fedora (RPM)
+
+Download the `x86_64` or `aarch64` RPM from the
+[latest release](https://github.com/akitaonrails/ai-memory/releases/latest),
+then install it:
+
+```bash
+sudo dnf install ./ai-memory-*.rpm
+```
+
+Then follow the native Linux service instructions in [`docs/install.md`](docs/install.md).
+
Single-user workstation:
```bash
diff --git a/crates/ai-memory-cli/tests/suite/packaging.rs b/crates/ai-memory-cli/tests/suite/packaging.rs
index db61b258..723a7845 100644
--- a/crates/ai-memory-cli/tests/suite/packaging.rs
+++ b/crates/ai-memory-cli/tests/suite/packaging.rs
@@ -294,7 +294,7 @@ fn docker_publish_jobs_use_prebuilt_binaries() {
assert!(release.contains("artifact: ai-memory-linux-aarch64"));
assert!(release.contains("artifact: ai-memory-macos-aarch64"));
assert!(release.contains("artifact: ai-memory-macos-x86_64"));
- assert!(release.contains("needs: [binary, macos, windows, validate-version]"));
+ assert!(release.contains("needs: [binary, macos, windows, rpm, validate-version]"));
assert!(release.contains("target: runtime-prebuilt-amd64"));
assert!(release.contains("target: runtime-prebuilt-arm64"));
diff --git a/docs/install.md b/docs/install.md
index ff774284..d018401a 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -1,12 +1,14 @@
# Installation cookbook
The [README quick-start](../README.md#quick-start) covers the happy
-paths (Docker + Claude Code, Arch AUR, macOS menu bar app). This page
-covers everything else:
+paths (Docker + Claude Code, Arch AUR, Fedora RPM, macOS menu bar app). This
+page covers everything else:
- [Server on a different machine](#server-on-a-different-machine)
(homelab, LAN box, remote server)
- [Configuring the CLI URL and auth](#configuring-the-cli-url-and-auth)
+- [Fedora native package (RPM)](#fedora-rpm)
+ (systemd system service or user service)
- [Arch Linux native packages (AUR)](#arch-linux-native-packages-aur)
(systemd system service or user service)
- [macOS menu bar app](#macos-menu-bar-app)
@@ -198,6 +200,15 @@ take precedence — see
---
+## Fedora (RPM)
+
+Download the `x86_64` or `aarch64` RPM from the
+[latest GitHub release](https://github.com/akitaonrails/ai-memory/releases/latest)
+and install it with `sudo dnf install ./ai-memory-*.rpm`. The package includes
+the binary, hook sources, system and user systemd units, and system service
+configuration. Follow the [user-level service](#user-level-service) or
+[system service](#system-service) steps below to initialize and start it.
+
## Arch Linux native packages (AUR)
Use the native packages when you want `/usr/bin/ai-memory` plus systemd units
diff --git a/packaging/rpm/ai-memory.spec b/packaging/rpm/ai-memory.spec
new file mode 100644
index 00000000..f8e0e322
--- /dev/null
+++ b/packaging/rpm/ai-memory.spec
@@ -0,0 +1,47 @@
+Name: ai-memory
+# The release workflow replaces this placeholder from Cargo.toml.
+Version: 0.3.2
+Release: 1
+Summary: Local-first long-term memory MCP server for AI coding agents
+License: MIT
+URL: https://github.com/akitaonrails/ai-memory
+Source0: https://github.com/akitaonrails/ai-memory/releases/download/v%{version}/ai-memory-linux-%{_arch}.tar.gz
+BuildArch: %{_arch}
+%global debug_package %{nil}
+Requires: systemd
+Requires: ca-certificates
+Requires: glibc
+%global _unitdir /usr/lib/systemd/system
+%global _userunitdir /usr/lib/systemd/user
+
+%description
+Cross-session memory for AI coding agents, with a local MCP server and
+systemd service.
+
+%prep
+%setup -q -c
+
+%install
+install -Dpm0755 ai-memory %{buildroot}%{_bindir}/ai-memory
+install -Dpm0644 README.md %{buildroot}%{_datadir}/doc/ai-memory/README.md
+install -Dpm0644 docs/install.md %{buildroot}%{_datadir}/doc/ai-memory/install.md
+install -Dpm0644 LICENSE %{buildroot}%{_licensedir}/ai-memory/LICENSE
+cp -a hooks %{buildroot}%{_datadir}/ai-memory/
+install -Dpm0644 packaging/systemd/ai-memory.service %{buildroot}%{_unitdir}/ai-memory.service
+install -Dpm0644 packaging/systemd/ai-memory-user.service %{buildroot}%{_userunitdir}/ai-memory.service
+install -Dpm0644 packaging/sysusers/ai-memory.conf %{buildroot}%{_prefix}/lib/sysusers.d/ai-memory.conf
+install -Dpm0644 packaging/tmpfiles/ai-memory.conf %{buildroot}%{_prefix}/lib/tmpfiles.d/ai-memory.conf
+install -Dpm0644 crates/ai-memory-cli/templates/config.default.toml %{buildroot}%{_sysconfdir}/ai-memory/config.toml
+install -Dpm0640 packaging/env/ai-memory.env %{buildroot}%{_sysconfdir}/ai-memory/env
+
+%files
+%config(noreplace) %{_sysconfdir}/ai-memory/config.toml
+%config(noreplace) %{_sysconfdir}/ai-memory/env
+%{_bindir}/ai-memory
+%{_datadir}/ai-memory/
+%{_datadir}/doc/ai-memory/
+%{_licensedir}/ai-memory/LICENSE
+%{_unitdir}/ai-memory.service
+%{_userunitdir}/ai-memory.service
+%{_prefix}/lib/sysusers.d/ai-memory.conf
+%{_prefix}/lib/tmpfiles.d/ai-memory.conf
diff --git a/scripts/check-native-packaging.sh b/scripts/check-native-packaging.sh
index cbc68d1e..5a3e3d1d 100755
--- a/scripts/check-native-packaging.sh
+++ b/scripts/check-native-packaging.sh
@@ -72,6 +72,13 @@ main() {
log "Skipping makepkg .SRCINFO check (makepkg unavailable or running as root)"
fi
+ if command -v rpmspec >/dev/null 2>&1; then
+ log "Checking RPM spec syntax"
+ rpmspec --parse --define '_arch x86_64' packaging/rpm/ai-memory.spec >/dev/null
+ else
+ log "Skipping RPM spec check (rpmspec unavailable)"
+ fi
+
TMP_ROOT="$(mktemp -d /tmp/ai-memory-native-root.XXXXXX)"
cleanup() {
if [ -n "${TMP_ROOT}" ]; then