Skip to content

Commit

Permalink
add: ollama-bin
Browse files Browse the repository at this point in the history
  • Loading branch information
bibelin committed Oct 16, 2024
1 parent 0c0bb46 commit 4435acc
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions packagelist
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ obsidian-deb
oh-my-posh-git
oh-my-zsh-git
oil
ollama-bin
onefetch-bin
onlyoffice-desktopeditors-deb
onnxruntime-bin
Expand Down
20 changes: 20 additions & 0 deletions packages/ollama-bin/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pkgbase = ollama-bin
gives = ollama
pkgver = 0.3.13
pkgdesc = Get up and running with large language models
url = https://ollama.com/
arch = amd64
arch = arm64
license = MIT
maintainer = bibelin <[email protected]>
repology = project:ollama
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
optdepends_debian = libcuda1: required to use CUDA on NVIDIA GPU
source_amd64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-amd64.tgz
sha256sums_amd64 = 19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984
sha256sums_amd64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
source_arm64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-arm64.tgz
sha256sums_arm64 = 28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721
sha256sums_arm64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a

pkgname = ollama-bin
80 changes: 80 additions & 0 deletions packages/ollama-bin/ollama-bin.pacscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
pkgname="ollama-bin"
gives="ollama"
pkgdesc="Get up and running with large language models"
repology=("project:ollama")
license=("MIT")
url='https://ollama.com/'
arch=("amd64" "arm64")
pkgver="0.3.13"
source=(
"https://github.com/${gives}/${gives}/releases/download/v${pkgver}/${gives}-linux-${CARCH}.tgz"
"ollama.service"
)
sha256sums_amd64=(
"19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984"
"e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a"
)
sha256sums_arm64=(
"28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721"
"e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a"
)
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"
)
optdepends_debian=(
"libcuda1: required to use CUDA on NVIDIA GPU"
)
maintainer=("bibelin <[email protected]>")

package() {
install -Dm755 "${srcdir}/bin/ollama" "${pkgdir}/usr/bin/${gives}"
find "${srcdir}/lib/${gives}" -type "f" -exec install -Dm644 "{}" -t "${pkgdir}/usr/lib/${gives}" \;
find "${srcdir}/lib/${gives}" -type "l" -exec install -Dm644 "{}" -t "${pkgdir}/usr/lib/${gives}" \;
install -Dm644 "${gives}.service" "${pkgdir}/usr/lib/systemd/system/${gives}.service"
}

post_install() {
# Adopted from https://github.com/ollama/ollama/blob/24636dfa87c3759b1d89efc47a1fd01623058fd1/scripts/install.sh#L105
if ! id ollama > /dev/null 2>&1; then
useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
fi
if getent group render > /dev/null 2>&1; then
usermod -a -G render ollama
fi
if getent group video > /dev/null 2>&1; then
usermod -a -G video ollama
fi

usermod -a -G ollama "${PACSTALL_USER}"

SYSTEMCTL_RUNNING="$(systemctl is-system-running || true)"
case ${SYSTEMCTL_RUNNING} in
running | degraded)
systemctl daemon-reload
systemctl enable ollama
systemctl start ollama
;;
*) ;;
esac
}

post_upgrade() {
SERVICE_ENABLED="$(systemctl is-enabled ollama || true)"
case ${SERVICE_ENABLED} in
enabled | enabled-runtime)
systemctl restart ollama
;;
*) ;;
esac
}

pre_remove() {
SYSTEMCTL_RUNNING="$(systemctl is-system-running || true)"
case ${SYSTEMCTL_RUNNING} in
running | degraded)
systemctl stop ollama
systemctl disable ollama
;;
*) ;;
esac
}
14 changes: 14 additions & 0 deletions packages/ollama-bin/ollama.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"

[Install]
WantedBy=default.target
21 changes: 21 additions & 0 deletions srclist
Original file line number Diff line number Diff line change
Expand Up @@ -7267,6 +7267,27 @@ pkgbase = oil

pkgname = oil
---
pkgbase = ollama-bin
gives = ollama
pkgver = 0.3.13
pkgdesc = Get up and running with large language models
url = https://ollama.com/
arch = amd64
arch = arm64
license = MIT
maintainer = bibelin <[email protected]>
repology = project:ollama
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
optdepends_debian = libcuda1: required to use CUDA on NVIDIA GPU
source_amd64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-amd64.tgz
sha256sums_amd64 = 19d8b87864d7d56d3bcf61b98e6a20bd68744037aba7515803f317dfdad62984
sha256sums_amd64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a
source_arm64 = https://github.com/ollama/ollama/releases/download/v0.3.13/ollama-linux-arm64.tgz
sha256sums_arm64 = 28cd33e4dd0cdb956272119839a349f7fc45ddd5b97978e2b19fc5804150d721
sha256sums_arm64 = e6893011419cf5d3073f713a130f112b61bbd1ce6f64ee9b4513c6f020f9624a

pkgname = ollama-bin
---
pkgbase = onefetch-bin
gives = onefetch
pkgver = 2.18.0
Expand Down

0 comments on commit 4435acc

Please sign in to comment.