public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tom Rix <Tom.Rix@amd.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ollama] epel10: Fix go2rpm specfile overwrite
Date: Mon, 09 Nov 2026 13:39:59 GMT	[thread overview]
Message-ID: <179423159923.1.2656560184907162042.rpms-ollama-4f669b8ac84b@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/ollama
            Branch : epel10
            Commit : 4f669b8ac84b261ef6da2128cad8136b8cb79613
            Author : Tom Rix <Tom.Rix@amd.com>
            Date   : 2026-04-02T20:04:49-07:00
            Stats  : +187/-20 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/ollama/c/4f669b8ac84b261ef6da2128cad8136b8cb79613?branch=epel10

            Log:
            Fix go2rpm specfile overwrite

Signed-off-by: Tom Rix <Tom.Rix@amd.com>

---
diff --git a/ollama.spec b/ollama.spec
index a423679..b11d6e6 100644
--- a/ollama.spec
+++ b/ollama.spec
@@ -1,5 +1,21 @@
-# Generated by go2rpm 1.19.0
-%bcond check 1
+# Generated by go2rpm 1.18.0
+# go2rpm -p vendor -v 0.12.11 --name ollama github.com/ollama/ollama
+%bcond check 0
+%ifarch x86_64
+%bcond rocm 1
+%else
+%bcond rocm 0
+%endif
+%bcond vulkan 1
+
+# 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
 
 # https://github.com/ollama/ollama
 %global goipath         github.com/ollama/ollama
@@ -7,10 +23,9 @@ Version:                0.19.0
 
 %gometa -L -f
 
-
 Name:           ollama
 Release:        %autorelease
-Summary:        Get up and running with Kimi-K2.5, GLM-5, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models
+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 BSL-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND ISC AND LicenseRef-Fedora-Public-Domain AND LicenseRef-scancode-protobuf AND MIT AND NCSA AND NTP AND OpenSSL AND ZPL-2.1 AND Zlib
@@ -19,31 +34,141 @@ 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
+
+Patch1:         0001-ollama-handle-load.patch
+# Patch2:         0001-ollama-crush-integration.patch
 
 BuildRequires:  go-vendor-tools
+BuildRequires:  fdupes
+BuildRequires:  gcc-c++
+BuildRequires:  cmake
+
+%if %{with systemd}
+BuildRequires:  systemd-rpm-macros
+%endif
+
+%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
+
+%if %{with vulkan}
+BuildRequires:  vulkan-loader-devel
+BuildRequires:  glslc
+%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 Kimi-K2.5, GLM-5, MiniMax, DeepSeek, gpt-oss, Qwen,
-Gemma and other models.
+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 -p1
-tar -xf %{S:1}
+%goprep -A
+%setup -q -T -D -a1 %{forgesetupargs}
+%autopatch -p1
+
+# Rename README's
+mv app/README.md app-README.md
+mv integration/README.md integration-README.md
+mv llama/README.md llama-README.md
+
+# No knob to turn off vulkan
+%if %{without vulkan}
+sed -i -e 's@Vulkan_FOUND@FALSE@' CMakeLists.txt
+%endif
 
 %generate_buildrequires
 %go_vendor_license_buildrequires -c %{S:2}
 
 %build
+
+%cmake \
+%if %{with rocm}
+    -DCMAKE_HIP_COMPILER=%rocmllvm_bindir/clang++ \
+    -DAMDGPU_TARGETS=%{rocm_gpu_list_default}
+%endif
+
+%cmake_build
+
 %global gomodulesmode GO111MODULE=on
-for cmd in cmd/* ; do
-  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
-done
+
+# 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=
 %gobuild -o %{gobuilddir}/bin/ollama %{goipath}
-for cmd in docs/tools/extract-examples x/imagegen/mlx x/mlxrunner/mlx/generator; do
-  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
-done
 
 %install
+
+%cmake_install
+
+# remove copies of system libraries
+runtime_removal="hipblas rocblas amdhip64 rocsolver amd_comgr hsa-runtime64 rocsparse tinfo rocprofiler-register drm drm_amdgpu numa elf vulkan"
+for rr in $runtime_removal; do
+    rm -rf %{buildroot}%{_prefix}/lib/ollama/lib${rr}*
+done
+rm -rf %{buildroot}%{_prefix}/lib/ollama/rocblas
+
+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}/
@@ -54,14 +179,56 @@ install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
 %gotest ./...
 %endif
 
-%files -f %{go_vendor_license_filelist}
-%doc docs CONTRIBUTING.md README.md SECURITY.md examples app/README.md
-%doc app/webview/README.md cmd/bench/README.md integration/README.md
-%doc llama/README.md runner/README.md docs x/imagegen/README.md
-%doc x/imagegen/cmd/engine/README.md x/imagegen/mlx/README.md
-%doc x/imagegen/tokenizer/README.md x/mlxrunner/mlx/include/mlx/c/README.md
+%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
+%{_prefix}/lib/ollama/libggml-base.so
+%{_prefix}/lib/ollama/libggml-base.so.0{,.*}
+%ifarch x86_64
+%{_prefix}/lib/ollama/libggml-cpu-alderlake.so
+%{_prefix}/lib/ollama/libggml-cpu-haswell.so
+%{_prefix}/lib/ollama/libggml-cpu-icelake.so
+%{_prefix}/lib/ollama/libggml-cpu-sandybridge.so
+%{_prefix}/lib/ollama/libggml-cpu-skylakex.so
+%{_prefix}/lib/ollama/libggml-cpu-sse42.so
+%{_prefix}/lib/ollama/libggml-cpu-x64.so
+%else
+# upstream CMakeLists.txt disables GGML CPU variants on aarch64
+%{_prefix}/lib/ollama/libggml-cpu.so
+%endif
 %{_bindir}/ollama
 
+%if %{with systemd}
+%attr(0755,ollama,ollama) %dir  %{_var}/lib/ollama/
+%{_unitdir}/ollama.service
+%{_sysusersdir}/ollama.conf
+%endif
+
+%if %{with rocm}
+%files rocm
+%{_prefix}/lib/ollama/libggml-hip.so
+%endif
+
+%if %{with vulkan}
+%files vulkan
+%{_prefix}/lib/ollama/libggml-vulkan.so
+%endif
+
 
 %changelog
 %autochangelog

                 reply	other threads:[~2026-11-09 13:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179423159923.1.2656560184907162042.rpms-ollama-4f669b8ac84b@fedoraproject.org \
    --to=tom.rix@amd.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox