mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
Compare commits
8 Commits
f40
...
mado/w39/ollama
| Author | SHA1 | Date | |
|---|---|---|---|
| 50327fcd4d | |||
| c3d2e0db9b | |||
| 307f38a39c | |||
| cd4a914aa4 | |||
| 71f9e83adb | |||
| 4c38fc08c4 | |||
| 5db361d659 | |||
| ec21f1f4f2 |
@@ -0,0 +1,5 @@
|
||||
project pkg {
|
||||
rpm {
|
||||
spec = "golang-github-ollama-ollama.spec"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
# Generated by go2rpm 1.9.0
|
||||
%bcond_without check
|
||||
|
||||
# https://github.com/ollama/ollama
|
||||
%global goipath github.com/ollama/ollama
|
||||
Version: 0.1.25
|
||||
|
||||
%gometa -f
|
||||
|
||||
|
||||
%global common_description %{expand:
|
||||
Get up and running with Llama 2, Mistral, and other large language models
|
||||
locally.}
|
||||
|
||||
%global golicenses LICENSE
|
||||
%global godocs docs examples README.md app/README.md\\\
|
||||
llm/ext_server/README.md
|
||||
|
||||
Name: %{goname}
|
||||
Release: %autorelease
|
||||
Summary: Get up and running with Llama 2, Mistral, and other large language models locally
|
||||
|
||||
License: MIT AND Apache-2.0
|
||||
URL: %{gourl}
|
||||
Source0: %{gosource}
|
||||
Source2: ollama.service
|
||||
Source3: sysusers.conf
|
||||
Source4: tmpfiles.d
|
||||
BuildRequires: git-core systemd-rpm-macros
|
||||
|
||||
%description %{common_description}
|
||||
|
||||
%gopkg
|
||||
|
||||
%prep
|
||||
%goprep
|
||||
git init .
|
||||
rm -frv llm/llama.cpp
|
||||
pushd llm/
|
||||
git clone --depth=1 --branch b2527 https://github.com/ggerganov/llama.cpp
|
||||
popd
|
||||
# Turn LTO on and set the build type to Release
|
||||
sed -i 's,T_CODE=on,T_CODE=on -D LLAMA_LTO=on -D CMAKE_BUILD_TYPE=Release,g' llm/generate/gen_linux.sh
|
||||
# Display a more helpful error message
|
||||
sed -i "s|could not connect to ollama server, run 'ollama serve' to start it|ollama is not running, try 'systemctl start ollama'|g" cmd/cmd.go
|
||||
%autopatch -p1
|
||||
go mod download
|
||||
|
||||
%build
|
||||
export CGO_CFLAGS="$CFLAGS" CGO_CPPFLAGS="$CPPFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"
|
||||
#go generate ./...
|
||||
go build -buildmode=pie -trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external \
|
||||
-ldflags=-buildid='' -ldflags="-X=github.com/jmorganca/ollama/version.Version=%version"
|
||||
|
||||
%install
|
||||
install -Dm755 ollama/ollama %buildroot%_bindir/ollama
|
||||
install -dm755 %buildroot/var/lib/ollama
|
||||
install -Dm644 %SOURCE2 %buildroot%_unitdir/ollama.service
|
||||
install -Dm644 %SOURCE3 %buildroot/usr/lib/sysusers.d/ollama.conf
|
||||
install -Dm644 %SOURCE4 %buildroot/usr/lib/tmpfiles.d/ollama.conf
|
||||
|
||||
%post
|
||||
%systemd_post ollama.service
|
||||
|
||||
%preun
|
||||
%systemd_preun ollama.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart ollama.service
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc docs examples README.md app/README.md llm/ext_server/README.md
|
||||
%{_bindir}/*
|
||||
/var/lib/ollama
|
||||
%_unitdir/ollama.service
|
||||
/usr/lib/sysusers.d/ollama.conf
|
||||
/usr/lib/tmpfiles.d/ollama.conf
|
||||
|
||||
%gopkgfiles
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Ollama Service
|
||||
Wants=network-online.target
|
||||
After=network.target network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/ollama serve
|
||||
WorkingDirectory=/var/lib/ollama
|
||||
Environment="HOME=/var/lib/ollama" "GIN_MODE=release"
|
||||
User=ollama
|
||||
Group=ollama
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Type=simple
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=full
|
||||
ProtectHome=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
g ollama - -
|
||||
u ollama - "ollama user" /var/lib/ollama
|
||||
@@ -0,0 +1,2 @@
|
||||
Q /var/lib/ollama 0755 ollama ollama
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
rpm.version(gh("ollama/ollama"));
|
||||
Reference in New Issue
Block a user