2024-02-26 10:11:49 +01:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2024-03-07 00:53:38 +01:00
|
|
|
|
2024-02-26 10:11:49 +01:00
|
|
|
Name: ollama
|
2024-03-07 00:53:38 +01:00
|
|
|
Version: 0.1.28
|
2024-02-26 10:11:49 +01:00
|
|
|
Release: 0
|
2024-02-27 13:34:45 +01:00
|
|
|
Summary: Tool for running AI models on-premise
|
2024-02-26 10:11:49 +01:00
|
|
|
License: MIT
|
|
|
|
URL: https://ollama.com
|
|
|
|
Source: %{name}-%{version}.tar.gz
|
|
|
|
Source1: vendor.tar.xz
|
|
|
|
Source2: ollama.service
|
|
|
|
Source3: %{name}-user.conf
|
|
|
|
Patch0: enable-lto.patch
|
|
|
|
BuildRequires: cmake >= 3.24
|
|
|
|
BuildRequires: gcc-c++ >= 11.4.0
|
|
|
|
BuildRequires: git
|
|
|
|
BuildRequires: sysuser-tools
|
|
|
|
BuildRequires: golang(API) >= 1.21
|
|
|
|
|
2024-02-27 04:54:15 +01:00
|
|
|
%{sysusers_requires}
|
2024-02-26 10:11:49 +01:00
|
|
|
|
|
|
|
%description
|
2024-02-27 13:34:45 +01:00
|
|
|
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.
|
2024-02-26 10:11:49 +01:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -a1 -p1
|
|
|
|
|
|
|
|
%build
|
|
|
|
%sysusers_generate_pre %{SOURCE3} %{name} %{name}-user.conf
|
|
|
|
|
|
|
|
%ifnarch ppc64
|
|
|
|
export GOFLAGS="-buildmode=pie -mod=vendor"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
export OLLAMA_SKIP_PATCHING=1
|
|
|
|
|
|
|
|
go generate ./...
|
|
|
|
go build .
|
|
|
|
|
|
|
|
%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
|
2024-02-27 04:54:15 +01:00
|
|
|
install -d %{buildroot}/var/lib/%{name}
|
2024-02-26 10:11:49 +01:00
|
|
|
|
|
|
|
%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
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%{_sysusersdir}/%{name}-user.conf
|
2024-02-27 04:54:15 +01:00
|
|
|
%attr(-, ollama, ollama) /var/lib/%{name}
|
2024-02-26 10:11:49 +01:00
|
|
|
|
|
|
|
%changelog
|