Skip to content

Commit 61998d7

Browse files
author
Balian of Ibelin
authored
add: ollama-bin (#6544)
## Progress - [x] Edit packagelist - [x] Add initial pacscript - [ ] Contact devs - [x] Add maintainer to pacscript Alpaca meets llama 😄
1 parent dafc4f4 commit 61998d7

File tree

5 files changed

+136
-0
lines changed

5 files changed

+136
-0
lines changed

packagelist

+1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ obsidian-deb
376376
oh-my-posh-git
377377
oh-my-zsh-git
378378
oil
379+
ollama-bin
379380
onefetch-bin
380381
onlyoffice-desktopeditors-deb
381382
onnxruntime-bin

packages/ollama-bin/.SRCINFO

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pkgbase = ollama-bin
2+
gives = ollama
3+
pkgver = 0.3.13
4+
pkgdesc = Get up and running with large language models
5+
url = https://ollama.com/
6+
arch = amd64
7+
arch = arm64
8+
license = MIT
9+
maintainer = bibelin <[email protected]>
10+
repology = project:ollama
11+
optdepends_ubuntu = libnvidia-compute-390 | libnvidia-compute-418 | libnvidia-compute-430 | libnvidia-compute-440 | libnvidia-compute-450 | libnvidia-compute-455 | libnvidia-compute-460 | libnvidia-compute-465 | libnvidia-compute-470 | libnvidia-compute-495 | libnvidia-compute-510 | libnvidia-compute-515 | libnvidia-compute-520 | libnvidia-compute-525 | libnvidia-compute-530 | libnvidia-compute-535 | libnvidia-compute-545 | libnvidia-compute-550: required to use CUDA on NVIDIA GPU
12+
optdepends_debian = libcuda1: required to use CUDA on NVIDIA GPU
13+
source_amd64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-amd64.tgz
14+
sha256sums_amd64 = 19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984
15+
sha256sums_amd64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
16+
source_arm64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-arm64.tgz
17+
sha256sums_arm64 = 28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721
18+
sha256sums_arm64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
19+
20+
pkgname = ollama-bin
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
pkgname="ollama-bin"
2+
gives="ollama"
3+
pkgdesc="Get up and running with large language models"
4+
repology=("project:ollama")
5+
license=("MIT")
6+
url='https://ollama.com/'
7+
arch=("amd64" "arm64")
8+
pkgver="0.3.13"
9+
source=(
10+
"https://github.com/${gives}/${gives}/releases/download/v${pkgver}/${gives}-linux-${CARCH}.tgz"
11+
"ollama.service"
12+
)
13+
sha256sums_amd64=(
14+
"19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984"
15+
"e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a"
16+
)
17+
sha256sums_arm64=(
18+
"28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721"
19+
"e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a"
20+
)
21+
optdepends_ubuntu=(
22+
"libnvidia-compute-390 | libnvidia-compute-418 | libnvidia-compute-430 | libnvidia-compute-440 | libnvidia-compute-450 | libnvidia-compute-455 | libnvidia-compute-460 | libnvidia-compute-465 | libnvidia-compute-470 | libnvidia-compute-495 | libnvidia-compute-510 | libnvidia-compute-515 | libnvidia-compute-520 | libnvidia-compute-525 | libnvidia-compute-530 | libnvidia-compute-535 | libnvidia-compute-545 | libnvidia-compute-550: required to use CUDA on NVIDIA GPU"
23+
)
24+
optdepends_debian=(
25+
"libcuda1: required to use CUDA on NVIDIA GPU"
26+
)
27+
maintainer=("bibelin <[email protected]>")
28+
29+
package() {
30+
install -Dm755 "${srcdir}/bin/ollama" "${pkgdir}/usr/bin/${gives}"
31+
find "${srcdir}/lib/${gives}" -type "f" -exec install -Dm644 "{}" -t "${pkgdir}/usr/lib/${gives}" \;
32+
find "${srcdir}/lib/${gives}" -type "l" -exec install -Dm644 "{}" -t "${pkgdir}/usr/lib/${gives}" \;
33+
install -Dm644 "${gives}.service" "${pkgdir}/usr/lib/systemd/system/${gives}.service"
34+
}
35+
36+
post_install() {
37+
# Adopted from https://github.com/ollama/ollama/blob/24636dfa87c3759b1d89efc47a1fd01623058fd1/scripts/install.sh#L105
38+
if ! id ollama > /dev/null 2>&1; then
39+
useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
40+
fi
41+
if getent group render > /dev/null 2>&1; then
42+
usermod -a -G render ollama
43+
fi
44+
if getent group video > /dev/null 2>&1; then
45+
usermod -a -G video ollama
46+
fi
47+
48+
usermod -a -G ollama "${PACSTALL_USER}"
49+
50+
SYSTEMCTL_RUNNING="$(systemctl is-system-running || true)"
51+
case ${SYSTEMCTL_RUNNING} in
52+
running | degraded)
53+
systemctl daemon-reload
54+
systemctl enable ollama
55+
systemctl start ollama
56+
;;
57+
*) ;;
58+
esac
59+
}
60+
61+
post_upgrade() {
62+
SERVICE_ENABLED="$(systemctl is-enabled ollama || true)"
63+
case ${SERVICE_ENABLED} in
64+
enabled | enabled-runtime)
65+
systemctl restart ollama
66+
;;
67+
*) ;;
68+
esac
69+
}
70+
71+
pre_remove() {
72+
SYSTEMCTL_RUNNING="$(systemctl is-system-running || true)"
73+
case ${SYSTEMCTL_RUNNING} in
74+
running | degraded)
75+
systemctl stop ollama
76+
systemctl disable ollama
77+
;;
78+
*) ;;
79+
esac
80+
}

packages/ollama-bin/ollama.service

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Ollama Service
3+
After=network-online.target
4+
5+
[Service]
6+
ExecStart=/usr/bin/ollama serve
7+
User=ollama
8+
Group=ollama
9+
Restart=always
10+
RestartSec=3
11+
Environment="PATH=$PATH"
12+
13+
[Install]
14+
WantedBy=default.target

srclist

+21
Original file line numberDiff line numberDiff line change
@@ -7267,6 +7267,27 @@ pkgbase = oil
72677267

72687268
pkgname = oil
72697269
---
7270+
pkgbase = ollama-bin
7271+
gives = ollama
7272+
pkgver = 0.3.13
7273+
pkgdesc = Get up and running with large language models
7274+
url = https://ollama.com/
7275+
arch = amd64
7276+
arch = arm64
7277+
license = MIT
7278+
maintainer = bibelin <[email protected]>
7279+
repology = project:ollama
7280+
optdepends_ubuntu = libnvidia-compute-390 | libnvidia-compute-418 | libnvidia-compute-430 | libnvidia-compute-440 | libnvidia-compute-450 | libnvidia-compute-455 | libnvidia-compute-460 | libnvidia-compute-465 | libnvidia-compute-470 | libnvidia-compute-495 | libnvidia-compute-510 | libnvidia-compute-515 | libnvidia-compute-520 | libnvidia-compute-525 | libnvidia-compute-530 | libnvidia-compute-535 | libnvidia-compute-545 | libnvidia-compute-550: required to use CUDA on NVIDIA GPU
7281+
optdepends_debian = libcuda1: required to use CUDA on NVIDIA GPU
7282+
source_amd64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-amd64.tgz
7283+
sha256sums_amd64 = 19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984
7284+
sha256sums_amd64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
7285+
source_arm64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-arm64.tgz
7286+
sha256sums_arm64 = 28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721
7287+
sha256sums_arm64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
7288+
7289+
pkgname = ollama-bin
7290+
---
72707291
pkgbase = onefetch-bin
72717292
gives = onefetch
72727293
pkgver = 2.18.0

0 commit comments

Comments
 (0)