forked from pool/ollama
Guillaume GARDET
5a3ae9ab21
I've created a package for Ollama (https://ollama.com) so that users don't have to use an install script. I will point out that this does not have CUDA support or ROCm enabled; we won't be able to package CUDA for obvious reasons, and ROCm is currently not packaged in Factory. However, for basic CPU-enabled use, this is better than curling a random script from the interwebs :) OBS-URL: https://build.opensuse.org/request/show/1150495 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/ollama?expand=0&rev=1
83 lines
2.1 KiB
RPMSpec
83 lines
2.1 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.1.27
|
|
Release: 0
|
|
Summary: Get up and running with Llama 2, Mistral, and other large language models
|
|
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
|
|
Requires(pre): shadow
|
|
|
|
%sysusers_requires
|
|
|
|
%description
|
|
Get up and running with Llama 2, Mistral, Gemma, and other large language models.
|
|
|
|
%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
|
|
install -d %{buildroot}%{_datadir}/%{name}
|
|
|
|
%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
|
|
%attr(-, ollama, ollama) %{_datadir}/%{name}
|
|
|
|
%changelog
|