Files
OmaPhoto/scripts/install/ubuntu.sh
T
雷电芽衣andClaude 2d219dd115 Packages carry their ONNX Runtime; a DEB per Ubuntu LTS
ONNX Runtime stamps its symbols with each release's version, so the
1.0.0 RPM demanded Fedora 42's exact runtime (issue #5) and the Arch
package would break on the next update. The RPM and the Arch package
now bundle Microsoft's 1.21.0 build, as the DEB does, and the images
test against it. The RPM builds on Fedora 43. A DEB built on Ubuntu
26.04 joins 24.04's, and ubuntu.sh picks by codename.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-26 14:22:16 -04:00

28 lines
1019 B
Bash
Executable File

#!/usr/bin/env bash
# Installs OmaPhoto's latest DEB on Ubuntu LTS and derivatives.
set -euo pipefail
base=https://github.com/ZacharyZhang-NY/OmaPhoto/releases/latest/download
. /etc/os-release
# Each DEB names its LTS's libraries; derivatives name their base.
case "${UBUNTU_CODENAME:-}" in
noble | resolute) ;;
*)
echo "This script is for Ubuntu 24.04 or 26.04 and systems built on them; this system is ${PRETTY_NAME:-unknown}." >&2
exit 1
;;
esac
package=omaphoto-${UBUNTU_CODENAME}_amd64.deb
if [ "$(uname -m)" != x86_64 ]; then
echo "OmaPhoto's packages are built for x86_64 alone." >&2
exit 1
fi
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
curl -fL --proto '=https' -o "$work/$package" "$base/$package"
curl -fsSL --proto '=https' -o "$work/SHA256SUMS" "$base/SHA256SUMS"
# The package must match the checksum published beside it.
(cd "$work" && grep " $package\$" SHA256SUMS | sha256sum -c -)
# apt reads the file as its own user.
chmod a+rx "$work"
sudo apt-get install -y "$work/$package"