Files
mistralrs-package/rpm/mistralrs.spec
rob thijssen a79eafd70f
Some checks failed
deploy-ui / build-and-deploy (push) Has been cancelled
feat: add prerelease RPM builds from upstream main branch
Poll upstream main branch HEAD alongside release tags. When a new commit
is detected, build and publish prerelease RPMs to a separate unstable
repo at rpm.lair.cafe/fedora/$releasever/$basearch/unstable/.

RPM versioning uses the Fedora snapshot convention (e.g.
0.8.1-0.1.20260511git1a2b3c4.fc43) so stable releases automatically
supersede any installed prerelease.

- RPM spec: conditional Release field via mistralrs_prerelease define
- poll-upstream.yml: new check-prerelease job fetches main HEAD + Cargo.toml version
- build-prerelease.yml: new workflow for commit-based builds without --locked
- UI: fetch both stable/unstable manifests, show channel badges, add
  unstable repo setup instructions to home page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-11 14:21:28 +03:00

86 lines
2.7 KiB
RPMSpec

%global _build_id_links none
%global debug_package %{nil}
%global __strip /usr/bin/true
# Passed in via --define at rpmbuild time
%{!?mistralrs_version: %global mistralrs_version 0.7.0}
%{!?mistralrs_flavour: %global mistralrs_flavour cuda13}
# For prerelease builds, pass --define "mistralrs_prerelease 0.1.YYYYMMDDgitSHORTSHA"
%if 0%{?mistralrs_prerelease:1}
%global mistralrs_release %{mistralrs_prerelease}
%else
%global mistralrs_release 1
%endif
Name: mistralrs-%{mistralrs_flavour}
Version: %{mistralrs_version}
Release: %{mistralrs_release}%{?dist}
Summary: Fast, flexible LLM inference server (mistral.rs, %{mistralrs_flavour} flavour)
License: MIT
URL: https://github.com/EricLBuehler/mistral.rs
# Pre-built binary (produced in the build job, not rebuilt here)
Source0: mistralrs-%{mistralrs_flavour}
Source1: mistralrs@.service
Source2: mistralrs@.conf.example
ExclusiveArch: x86_64
# Suppress auto-detected CUDA library dependencies. The binary links against
# the CUDA runtime, cuDNN, NCCL, etc. but we don't want rpm to pin exact
# soname versions — consumers may have CUDA from multiple sources (nvidia
# direct, rpmfusion, etc.) and different compatible versions. A runtime
# dlopen failure gives a clearer error than rpm dep resolution would.
%global __requires_exclude ^lib(cuda|cudart|cudnn|cublas|cublasLt|curand|nvrtc|nccl)
Requires: systemd
%description
mistral.rs is a blazingly fast LLM inference engine written in Rust.
This package provides the %{mistralrs_flavour} flavour, built with features:
cuda, cudnn, and optionally flash-attn and nccl depending on flavour name.
%prep
cp %{SOURCE0} .
cp %{SOURCE1} .
cp %{SOURCE2} .
%build
# Already built
%install
install -D -m 0755 mistralrs-%{mistralrs_flavour} \
%{buildroot}%{_bindir}/mistralrs
install -D -m 0644 mistralrs@.service \
%{buildroot}%{_unitdir}/mistralrs@.service
install -D -m 0644 mistralrs@.conf.example \
%{buildroot}%{_sysconfdir}/mistralrs/default.conf.example
# Patch the unit to point at the binary
sed -i "s|@BINARY@|%{_bindir}/mistralrs|g" \
%{buildroot}%{_unitdir}/mistralrs@.service
sed -i "s|@FLAVOUR@|%{mistralrs_flavour}|g" \
%{buildroot}%{_unitdir}/mistralrs@.service
%pre
getent group mistralrs >/dev/null || groupadd -r mistralrs
getent passwd mistralrs >/dev/null || useradd -r -g mistralrs -d /var/lib/mistralrs -s /sbin/nologin mistralrs
%post
%systemd_post mistralrs@.service
%preun
%systemd_preun mistralrs@.service
%postun
%systemd_postun_with_restart mistralrs@.service
%files
%{_bindir}/mistralrs
%{_unitdir}/mistralrs@.service
%{_sysconfdir}/mistralrs/default.conf.example
%changelog