forked from pool/ollama
* Refine default thread selection for NUMA systems (#7322) * runner.go: Better abstract vision model integration * Soften windows clang requirement (#7428) * Remove submodule and shift to Go server - 0.4.0 (#7157) * Move windows app out of preview (#7347) * windows: Support alt install paths, fit and finish (#6967) * add more tests for getting the optimal tiled canvas (#7411) * Switch windows to clang (#7407) * tests: Add test for Unicode processing * runner.go: Better handle return NULL values from llama.cpp * add mllama image processing to the generate handler (#7384) * Bump to latest Go 1.22 patch (#7379) * Fix deepseek deseret regex (#7369) * Better support for AMD multi-GPU on linux (#7212) * Fix unicode output on windows with redirect to file (#7358) * Fix incremental build file deps (#7361) * Improve dependency gathering logic (#7345) * fix #7247 - invalid image input (#7249) * integration: harden embedding test (#7306) * default to "FROM ." if a Modelfile isn't present (#7250) * Fix rocm windows build and clean up dependency gathering (#7305) * runner.go: Merge partial unicode characters before sending * readme: add Ollama for Swift to the community integrations (#7295) * server: allow vscode-webview origin (#7273) * image processing for llama3.2 (#6963) * llama: Decouple patching script from submodule (#7139) * llama: add compiler tags for cpu features (#7137) OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/ollama?expand=0&rev=59
114 lines
2.9 KiB
RPMSpec
114 lines
2.9 KiB
RPMSpec
#
|
|
# spec file for package ollama
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: ollama
|
|
Version: 0.4.0-rc6
|
|
Release: 0
|
|
Summary: Tool for running AI models on-premise
|
|
License: MIT
|
|
URL: https://ollama.com
|
|
Source: %{name}-%{version}.tar
|
|
Source1: vendor.tar.zstd
|
|
Source2: ollama.service
|
|
Source3: %{name}-user.conf
|
|
Patch0: enable-lto.patch
|
|
BuildRequires: cmake >= 3.24
|
|
BuildRequires: git
|
|
BuildRequires: sysuser-tools
|
|
BuildRequires: zstd
|
|
BuildRequires: golang(API) >= 1.22
|
|
%sysusers_requires
|
|
%if 0%{?sle_version} == 150600
|
|
BuildRequires: gcc12-c++
|
|
BuildRequires: libstdc++6-gcc12
|
|
%else
|
|
BuildRequires: gcc-c++ >= 11.4.0
|
|
%endif
|
|
# 32bit seems not to be supported anymore
|
|
ExcludeArch: %ix86 %arm
|
|
|
|
%description
|
|
Ollama is a tool for running AI models on one's own hardware.
|
|
It offers a command-line interface and a RESTful API.
|
|
New models can be created or existing ones modified in the
|
|
Ollama library using the Modelfile syntax.
|
|
Source model weights found on Hugging Face and similar sites
|
|
can be imported.
|
|
|
|
%prep
|
|
%autosetup -a1 -p1
|
|
|
|
%build
|
|
%sysusers_generate_pre %{SOURCE3} %{name} %{name}-user.conf
|
|
|
|
%ifnarch ppc64
|
|
export GOFLAGS="-buildmode=pie -mod=vendor"
|
|
%endif
|
|
%if 0%{?sle_version} == 150600
|
|
export CXX=g++-12
|
|
export CC=gcc-12
|
|
# pie doesn't work with gcc12 on leap
|
|
export GOFLAGS="-mod=vendor"
|
|
%endif
|
|
|
|
export OLLAMA_SKIP_PATCHING=1
|
|
|
|
go generate ./...
|
|
go build -v .
|
|
|
|
%install
|
|
install -D -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}-user.conf
|
|
install -d %{buildroot}%{_localstatedir}/lib/%{name}
|
|
|
|
mkdir -p "%{buildroot}/%{_docdir}/%{name}"
|
|
cp -Ra docs/* "%{buildroot}/%{_docdir}/%{name}"
|
|
|
|
%check
|
|
%if 0%{?sle_version} == 150600
|
|
export CXX=g++-12
|
|
export CC=gcc-12
|
|
# pie doesn't work with gcc12 on leap
|
|
export GOFLAGS="-mod=vendor"
|
|
%endif
|
|
go test ./...
|
|
|
|
%pre -f %{name}.pre
|
|
%service_add_pre %{name}.service
|
|
|
|
%post
|
|
%service_add_post %{name}.service
|
|
|
|
%preun
|
|
%service_del_preun %{name}.service
|
|
|
|
%postun
|
|
%service_del_postun %{name}.service
|
|
|
|
%files
|
|
%doc README.md
|
|
%license LICENSE
|
|
%{_docdir}/%{name}
|
|
%{_bindir}/%{name}
|
|
%{_unitdir}/%{name}.service
|
|
%{_sysusersdir}/%{name}-user.conf
|
|
%attr(-, ollama, ollama) %{_localstatedir}/lib/%{name}
|
|
|
|
%changelog
|