Files
mistralrs-package/rpm/mistralrs.spec
rob thijssen b8e568b8bf
All checks were successful
poll-upstream / check (push) Successful in 1s
refactor(rpm): simplify to single /usr/bin/mistralrs-server binary
Drop the flavour-suffixed binary name, flavour-specific systemd unit
names, and update-alternatives machinery. Install a plain
mistralrs-server binary, a single mistralrs@.service template, and
a default.conf.example. Flavour coexistence was over-engineered for
the target audience.

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

76 lines
2.4 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}
Name: mistralrs-server-%{mistralrs_flavour}
Version: %{mistralrs_version}
Release: 1%{?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-server-%{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
Provides: mistralrs-server = %{version}-%{release}
%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-server-%{mistralrs_flavour} \
%{buildroot}%{_bindir}/mistralrs-server
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-server|g" \
%{buildroot}%{_unitdir}/mistralrs@.service
sed -i "s|@FLAVOUR@|%{mistralrs_flavour}|g" \
%{buildroot}%{_unitdir}/mistralrs@.service
%post
%systemd_post mistralrs@.service
%preun
%systemd_preun mistralrs@.service
%postun
%systemd_postun_with_restart mistralrs@.service
%files
%{_bindir}/mistralrs-server
%{_unitdir}/mistralrs@.service
%{_sysconfdir}/mistralrs/default.conf.example
%changelog