install.sh
AArch64 (ARM64) architecture stringMentions the /lib64 directory
SHA-2561c557d0d60e0548cd3564a85d30be2b86cd3d7368caca410be2cd0055f5c04d6
Evidence
1#!/bin/sh
2# SPDX-License-Identifier: MIT OR Apache-2.0
3# SPDX-FileCopyrightText: The sipnab contributors
4
5# sipnab installer — https://sipnab.com/install.sh
6#
7# curl -fsSL https://sipnab.com/install.sh | sh
8#
9# Detects OS (Linux/macOS), CPU (x86_64/aarch64), and glibc version, downloads
10# the matching release tarball from GitHub, verifies its sha256, and installs
11# the binary to /usr/local/bin (override with SIPNAB_INSTALL_DIR).
12#
13# The glibc floor of the -gnu builds; hosts below this get the static musl
14# build instead. Must equal the floor enforced by the "Enforce glibc floor"
15# step in release.yml and glibc_floor in w …
30:8… printf 'sipnab-install: error: %s\n' "$1" >&2; exit 1; }
31info() { printf 'sipnab-install: %s\n' "$1"; }
32
33# `uname -s` on Windows: Git for Windows and MSYS2 print MINGW64_NT-...,
34# MINGW32_NT-... or MSYS_NT-..., Cygwin prints CYGWIN_NT-..., and s …
35:46… has never been tried, so the
36# message offers no workaround.
37detect_os() {
38 case "${1:-}" in
39 Linux) echo linux ;;
40 Darwin) echo darwin ;;
41 MINGW*|MSYS*|CYGWIN*|Windows_NT)
42 printf 'sipnab-install: error: unsupported OS "%s": sipnab currently focuses on Linux and macOS. Windows is not supported yet. Pull requests that add Windows support are welcome: https://github.com/%s/blob/main/CONTRIBUTING.md\n' "$1" "$SIPNAB_REPO" >&2; return 1 ;;
43 *) printf 'sipnab-install: error: unsupported OS "%s" (sipnab currently focuses on Linux and macOS)\n' "${1:-}" >&2; return 1 ;;
44 esac
45}
46
47detect_arch() {
48 case "${1:-}" in
49 x86_64|amd64) echo x86_64 ;;
50 aarch64|arm64) echo aarch64 ;;
51 *) printf 'sipnab-install: error: unsupported CPU "%s" (x86_64/amd64 and aarch64/arm64 only)\n' "${1:-}" >&2; return 1 ;;
52 esac
53}
54
55# Read the glibc version out of ldd's first line. Empty exit 1 on musl, which
56# is …
67:79…
68# audio feature. Matching "GNU libc" too would have fixed those distros and
69# waited for the next vendor to rename its banner. The version is the last
70# token of line 1 in every glibc family, and musl prints no version there.
71parse_glibc_version() {
72 _v=$(printf '%s\n' "${1:-}" | awk 'NR==1{print $NF}' \
73 | sed -n 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
74 [ -n "$_v" ] || { printf 'sipnab-install: not a glibc host\n' >&2; return 1; }
75 echo "$_v"
76}
77
78# glibc_at_least <have> …
78:33… �� "yes"/"no", numeric per-component compare
79glibc_at_least() {
80 _maj1=${1%%.*}; _min1=${1#*.}
81 _maj2=${2%%.*}; _min2=${2#*.}
82 if [ "$_maj1" -gt "$_maj2" ] 2>/dev/null; then echo yes
83 elif [ "$_maj1" -eq "$_maj2" ] 2>/dev/null && [ "$_min1" -ge "$_min2" ] 2>/dev/null; then echo yes
84 else echo …