Compare commits

...

8 Commits

Author SHA1 Message Date
madomado 50327fcd4d Update golang-github-ollama-ollama.spec
Signed-off-by: madomado <madonuko@outlook.com>
2024-03-25 22:44:02 +08:00
madomado c3d2e0db9b Update golang-github-ollama-ollama.spec
Signed-off-by: madomado <madonuko@outlook.com>
2024-03-25 22:19:48 +08:00
madomado 307f38a39c Rename golang-github-jmorganca-ollama.spec to golang-github-ollama-ollama.spec
Signed-off-by: madomado <madonuko@outlook.com>
2024-02-20 10:54:17 +08:00
madomado cd4a914aa4 update upstream to ollama/ollama 2024-02-20 10:48:23 +08:00
madomado 71f9e83adb Update golang-github-jmorganca-ollama.spec
Signed-off-by: madomado <madonuko@outlook.com>
2024-02-13 10:47:51 +08:00
madomado 4c38fc08c4 fix: ollama (by referencing the one from Arch Linux real) 2024-02-12 13:04:41 +08:00
madomado 5db361d659 Update golang-github-jmorganca-ollama.spec
Signed-off-by: madomado <madonuko@outlook.com>
2024-02-06 17:33:07 +08:00
madomado ec21f1f4f2 add: ollama 2024-02-06 17:18:22 +08:00
6 changed files with 114 additions and 0 deletions
+5
View File
@@ -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
+21
View File
@@ -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
+2
View File
@@ -0,0 +1,2 @@
g ollama - -
u ollama - "ollama user" /var/lib/ollama
+2
View File
@@ -0,0 +1,2 @@
Q /var/lib/ollama 0755 ollama ollama
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("ollama/ollama"));