## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; 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.18.0 # go2rpm -p vendor -v 0.12.11 --name ollama github.com/ollama/ollama %bcond check 0 # bundled GGML sources are missing ppc64le and s390x ExcludeArch: ppc64le s390x # Build the next version of ollama %bcond next 0 # systemd testing %bcond systemd 1 %ifarch x86_64 %global rocm_gpu_list "gfx9-generic;gfx942;gfx950;gfx10-1-generic;gfx10-3-generic;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" %bcond rocm 1 %global backend_config \\\ -DOLLAMA_LLAMA_BACKENDS="vulkan;rocm_v7_2" \\\ -DAMDGPU_TARGETS=%{rocm_gpu_list} %else %bcond rocm 0 %global backend_config \\\ -DOLLAMA_LLAMA_BACKENDS=vulkan \\\ %endif %bcond vulkan 1 %if %{with rocm} %global toolchain rocm # hipcc does not support some clang flags %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/' -e 's/-mtls-dialect=gnu2//') %else %global toolchain gcc %endif %global cmake_config \\\ %{backend_config} \\\ -DCMAKE_INSTALL_RPATH=%{_prefix}/lib/ollama/ \\\ -DCMAKE_SKIP_INSTALL_RPATH=ON \\\ -DCMAKE_SKIP_RPATH=ON # https://github.com/ollama/ollama %global goipath github.com/ollama/ollama %if %{with next} Version: 0.32.8 %else Version: 0.35.1 %endif %gometa -L -f Name: ollama Release: %autorelease Summary: Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-HP AND ISC AND LicenseRef-Fedora-Public-Domain AND MIT AND Unlicense URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml %if %{with systemd} Source10: ollama.service Source11: ollama.sysusers %endif # From LLAMA_CPP_VERSION %global llama_cpp_version b11232 Source20: https://github.com/ggerganov/llama.cpp/archive/%{llama_cpp_version}.tar.gz#/llama.cpp-%{llama_cpp_version}.tar.gz Patch1: 0001-ollama-download-env-variables.patch Patch2: 0001-ollama-no-rpaths.patch BuildRequires: go-vendor-tools BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: chrpath BuildRequires: curl BuildRequires: git BuildRequires: wget BuildRequires: xxd BuildRequires: langpacks-en BuildRequires: libcurl-devel BuildRequires: openmpi BuildRequires: pthreadpool-devel %if %{with rocm} BuildRequires: hipblas-devel BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocblas-devel BuildRequires: hipblas-devel BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros %endif %if %{with vulkan} BuildRequires: glslc BuildRequires: spirv-headers-devel BuildRequires: vulkan-loader-devel %endif %if %{with systemd} BuildRequires: systemd-rpm-macros %{?systemd_requires} %endif Requires: %{name}-base%{?_isa} = %{version}-%{release} %if %{with rocm} Requires: %{name}-rocm%{?_isa} = %{version}-%{release} %endif %if %{with vulkan} Requires: %{name}-vulkan%{?_isa} = %{version}-%{release} %endif %description Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models. %package base Summary: The base ollama %if %{with systemd} %{?systemd_requires} %endif %description base %{summary} %if %{with rocm} %package rocm Summary: The ROCm backend for ollama Requires: hipblas Requires: rocblas %description rocm %{summary} %endif %if %{with vulkan} %package vulkan Summary: The Vulkan backend for ollama %description vulkan %{summary} %endif %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} %autopatch -p1 tar xzf %{SOURCE20} -C ./llama/ --strip-components=1 # we are bundling because ollama patches llama.cpp to workaround problems # with the system llama.cpp cd llama # check when upstream ollama stops patching and throw an error if [ ! -d compat ] || [ -z "$(ls compat/*.patch 2>/dev/null)" ]; then echo "Good news! No patches found in compat/, you can stop bundling llama.cpp" false fi # Apply all patches manually in order. # 001 is the "Ollama Hooks" patch (Fixes the model loading/metadata issues) # 002 is the "CLEF" patch (Fixes Vision/CLEF architecture issues) for p in compat/0*.patch; do echo "Applying $p..." patch -p1 < "$p" done cd .. # Force the llama.cpp source dir sed -i '/compat\/compat.cmake/a set(FETCHCONTENT_SOURCE_DIR_LLAMA_CPP "${CMAKE_SOURCE_DIR}/llama" CACHE PATH "" FORCE)' cmake/local.cmake # Rename README's mv app/README.md app-README.md mv integration/README.md integration-README.md mv llama/README.md llama-README.md # web-search ollama plugins are not working well # Here is what they do https://docs.ollama.com/capabilities/web-search # disable # # For openclaw.go # if ensureWebSearchPlugin() { # registerWebSearchPlugin() # } sed -i '/if ensureWebSearchPlugin()/,+2d' cmd/launch/openclaw.go # # For pi.go sed -i '/ensurePiWebSearchPackage(bin)/d' cmd/launch/pi.go # sqlite3-binding.c:123934:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] sed -i 's@zTail = strrchr@zTail = (char \*)strrchr@' vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %cmake %{cmake_config} %cmake_build %global gomodulesmode GO111MODULE=on # Debug with: # Manual build when there are problems # export GOPATH=$(pwd)/_build:%{gopath} # export GO111MODULE=off # go build -o %{gobuilddir}/bin/ollama %{goipath} # Release with # cmake sets LDFLAGS env, this confuses gobuild export LDFLAGS= export GO_LDFLAGS="-X=github.com/ollama/ollama/version.Version=%{version} -X=github.com/ollama/ollama/server.mode=release" %gobuild -o %{gobuilddir}/bin/ollama %{goipath} %install %cmake_install for f in `find %{buildroot}%{_prefix}/lib/ollama -name 'libggml*.so'`; do chrpath -d $f done %if %{with rocm} rm -rf %{buildroot}%{_prefix}/lib/ollama/rocm_v7_2/rocblas R="libamd_comgr libamdhip64 libdrm_amdgpu libdrm libelf libhipblas libhsa-runtime64 libnuma librocblas librocsolver" for r in $R; do rm -f %{buildroot}%{_prefix}/lib/ollama/rocm_v7_2/${r}* done %endif mkdir -p %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/ollama %{buildroot}%{_bindir} rm -rf %{buildroot}%{_bindir}/*.so %if %{with systemd} install -p -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/ollama.service install -p -D -m 0644 %{SOURCE11} %{buildroot}%{_sysusersdir}/ollama.conf # home dir mkdir -p %{buildroot}%{_var}/lib/ollama %endif %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %check # Verify llama.cpp version matches the spec file # Read the version from the local source file (ignoring whitespace/newlines) if [ -f LLAMA_CPP_VERSION ]; then read -r LOCAL_LLAMA_CPP_VERSION < LLAMA_CPP_VERSION # Compare against the global variable defined at the top of the spec if [ ${LOCAL_LLAMA_CPP_VERSION} != "%{llama_cpp_version}" ]; then echo "FATAL: Build aborted. llama.cpp source version does not match spec file." >&2 echo " Spec File version: %{llama_cpp_version}" >&2 echo " Source File version: ${LOCAL_LLAMA_CPP_VERSION}" >&2 false fi else echo "Could not find LLAMA_CPP_VERSION file" false fi %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./... %endif %if %{with systemd} %preun %systemd_preun ollama.service %post %systemd_post ollama.service %postun %systemd_postun_with_restart ollama.service %endif %files %doc README.md %files -f %{go_vendor_license_filelist} base %license vendor/modules.txt %doc CONTRIBUTING.md SECURITY.md README.md app-README.md integration-README.md %doc llama-README.md %{_bindir}/ollama %{_prefix}/lib/ollama/llama-server %{_prefix}/lib/ollama/llama-quantize %if %{with systemd} %attr(0755,ollama,ollama) %dir %{_var}/lib/ollama/ %{_unitdir}/ollama.service %{_sysusersdir}/ollama.conf %endif %{_prefix}/lib/ollama/*_LICENSE %{_prefix}/lib/ollama/libggml* %{_prefix}/lib/ollama/libllama* %{_prefix}/lib/ollama/libmt* %if %{with rocm} %files rocm %{_prefix}/lib/ollama/rocm_v7_2/ %endif %if %{with vulkan} %files vulkan %{_prefix}/lib/ollama/vulkan/ %endif %changelog ## START: Generated by rpmautospec * Sun Oct 11 2026 Tom Rix - 0.35.1-1 - Update to 0.35.1 * Tue Sep 01 2026 Tom Rix - 0.33.1-1 - Update to 0.33.1 * Tue Aug 18 2026 Tom Rix - 0.32.8-1 - Update to 0.32.8 * Thu Jul 16 2026 Fedora Release Engineering - 0.24.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild * Sun Jul 12 2026 Tom Rix - 0.24.0-3 - Need to use the patch * Sun Jul 12 2026 Tom Rix - 0.24.0-2 - Make the download and upload tunable by enviromental variables. * Sat Jul 04 2026 Tom Rix - 0.24.0-1 - Update to 0.24.0 * Thu Jun 11 2026 Tom Rix - 0.23.4-3 - RPMAUTOSPEC: unresolvable merge ## END: Generated by rpmautospec