## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.14.0 %bcond check 1 %global ggml_arches x86_64 aarch64 %global romc_arches x86_64 %global ggml_license ml/backend/ggml/ggml/LICENSE %ifarch %{ggml_arches} %bcond ggml 1 %else %bcond ggml 0 %endif %ifarch %{romc_arches} %bcond rocm 1 %else %bcond rocm 0 %endif # build problems on ppc64le and s390x ExcludeArch: ppc64le s390x %define _vpath_builddir %{_vendor}-%{_target_os}-build_%{ggml_preset} %global ggml_privatelibs libggml-.*\\.so.* %global __provides_exclude_from ^(%{_libdir}/ollama/%{ggml_privatelibs})$ %global __requires_exclude ^(%{ggml_privatelibs})$ # https://github.com/ollama/ollama %global goipath github.com/ollama/ollama %global forgeurl https://github.com/ollama/ollama Version: 0.12.3 %gometa -L -f %global common_description %{expand: Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models.} %global golicenses LICENSE %global godocs docs CONTRIBUTING.md README.md SECURITY.md Name: ollama Release: %autorelease Summary: Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models License: Apache-2.0 AND MIT URL: %{gourl} Source0: %{gosource} # Fixup ollama to look at gtt vs vram mem and enable iGPU's # https://github.com/Crandel/ollama-amd-igpu.git # d70b7b91791181c0bca95dbbc223f9f3543f3747 # Never applied since cb027a828de742cf4ecee6261866c228f6acedb9 # Patch broken and upstream archived, so dropping for now # Patch0: 0001-rewrite-for-ollama-4.0.patch # Remove cuda and rocm runtime from cmake install targets Patch0: remove-runtime-for-cuda-and-rocm.patch # Temporary patch to work with _libdir Patch1: replace-library-paths.patch BuildRequires: gcc-c++ %if %{with ggml} BuildRequires: cmake Recommends: ollama-ggml %if %{with rocm} BuildRequires: hipblas-devel BuildRequires: rocblas-devel BuildRequires: rocm-comgr-devel BuildRequires: rocm-compilersupport-macros BuildRequires: rocm-runtime-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-rpm-macros BuildRequires: rocminfo %endif %endif %description %{common_description} %gopkg %prep %goprep -A %autopatch -p1 %generate_buildrequires %go_generate_buildrequires %build export GO_LDFLAGS=" \ -X github.com/ollama/ollama/ml/backend/ggml/ggml/src.libDir=%{_libdir}/ollama \ -X github.com/ollama/ollama/discover.libDir=%{_libdir}/ollama \ -X github.com/ollama/ollama/server.mode=release" %gobuild -o %{gobuilddir}/bin/ollama %{goipath} # build ggml backends %if %{with ggml} # ggml-cpu %global ggml_preset ggml-cpu %cmake --preset "CPU" %cmake_build --target ggml-cpu # ggml-rocm %if %{with rocm} %global ggml_preset ggml-rocm-6 %cmake --preset "ROCm 6" %cmake_build --target ggml-hip %endif %endif %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %if %{with ggml} # ggml-cpu %global ggml_preset ggml-cpu %cmake_install --component "CPU" # ggml-rocm %if %{with rocm} %global ggml_preset ggml-rocm-6 %cmake_install --component "HIP" %endif %endif %if %{with check} %check %gocheck %endif %files %license %{golicenses} %doc %{godocs} %{_bindir}/ollama %if %{with ggml} %package ggml Summary: GGML base library vendored by ollama License: MIT Requires: ollama%{?_isa} = %{version}-%{release} %description ggml %{common_description} This package contains the GGML base library vendored by ollama. %files ggml %license %{ggml_license} %{_libdir}/ollama/libggml-base.so %package ggml-cpu Summary: GGML CPU backends for ollama License: MIT Requires: ollama-ggml%{?_isa} = %{version}-%{release} Supplements: ollama-ggml%{?_isa} %description ggml-cpu %{common_description} This package contains the GGML CPU backends for ollama. %files ggml-cpu %license %{ggml_license} %{_libdir}/ollama/libggml-cpu-*.so %if %{with rocm} %package ggml-rocm Summary: GGML ROCm backend for ollama License: MIT Requires: ollama-ggml%{?_isa} = %{version}-%{release} Requires: hipblas Requires: rocblas Supplements: ollama-ggml%{?_isa} if rocm-hip%{?_isa} %description ggml-rocm %{common_description} This package contains the GGML ROCm backend for ollama. %files ggml-rocm %license %{ggml_license} %{_libdir}/ollama/libggml-hip.so %endif %endif %changelog ## START: Generated by rpmautospec * Wed Oct 01 2025 Fachep - 0.12.3-3 - Split packages Ollama should be divided into packages: - `ollama`: the ollama binary, minimal installation. Recommends `ollama-ggml` on supported architectures. - `ollama-ggml`: [optional] the ggml-base.so vendored by ollama. Supports hardware-acceleration provided by backends. - `ollama-ggml-cpu`: [optional] the ggml-cpu-*.so backends. Requires `ollama-ggml` and supplements `ollama`. - `ollama-ggml-rocm`: [optional] the ggml-hip.so backend for AMD ROCm. Requires `ollama-ggml` and supplements `ollama` when runtimes installed. * Mon Sep 29 2025 Tom Rix - 0.12.3-2 - Build problems, disable ppc and s390 * Sun Sep 28 2025 Tom Rix - 0.12.3-1 - Update to 0.12.3 * Fri Aug 15 2025 Maxwell G - 0.9.4-4 - Rebuild for golang-1.25.0 * Fri Aug 08 2025 Tom Rix - 0.9.4-3 - Fix AMD APU support * Thu Jul 24 2025 Fedora Release Engineering - 0.9.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Sun Jul 20 2025 Tom Rix - 0.9.4-1 - Update to 0.9.4 * Tue Jul 15 2025 Tom Rix - 0.5.9-7 - Prep for 0.9.4 * Thu May 01 2025 Tom Rix - 0.5.9-6 - Rebuild for ROCm 6.4.0 * Mon Mar 17 2025 Fachep han - 0.5.9-5 - Fix missing seperator * Mon Mar 17 2025 Fachep han - 0.5.9-4 - Fix skipping path of /usr/lib64/ollama in ggml * Sun Mar 16 2025 Fachep han - 0.5.9-3 - Hardcoden LibOllamaPath to /usr/lib64/ollama * Sat Mar 15 2025 Tom Rix - 0.5.9-2 - Remove the excludearch restrictions * Wed Mar 12 2025 Tom Rix - 0.5.9-1 - Update to 5.9 * Thu Jan 30 2025 Tom Rix - 0.4.4-3 - Add more gpus * Tue Jan 21 2025 Tom Rix - 0.4.4-2 - Use ExcludeArch instead of ExclusiveArch * Tue Jan 21 2025 Tom Rix - 0.4.4-1 - Initial package ## END: Generated by rpmautospec