diff --git a/dist/arch/build-pkg.sh b/dist/arch/build-pkg.sh index 5ab9c4e..89eaf85 100755 --- a/dist/arch/build-pkg.sh +++ b/dist/arch/build-pkg.sh @@ -55,7 +55,8 @@ if [ -n "$tray" ]; then relations=$'conflict = tsunagi\nprovides = tsunagi\nreplaces = tsunagi\n' # What the tray and its window load at run time; none of it is linked in # statically, so pacman has to be told. - for dep in gtk3 libayatana-appindicator libxkbcommon wayland libx11 libglvnd; do + glibc_min=$(bash "$here/../linux/required-glibc.sh" "$tray") + for dep in "glibc>=$glibc_min" gtk3 libayatana-appindicator libxkbcommon wayland libx11 libglvnd; do relations+="depend = ${dep}"$'\n' done install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" @@ -77,6 +78,7 @@ builddate = $(date +%s) packager = AB size = ${size} arch = ${arch} +depend = shadow ${relations}license = WTFPL PKGINFO diff --git a/dist/deb/build-deb.sh b/dist/deb/build-deb.sh index d422698..fdfb8b0 100755 --- a/dist/deb/build-deb.sh +++ b/dist/deb/build-deb.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Assemble a dependency-free Debian package from prebuilt tsunagi binaries, +# Assemble a Debian package from prebuilt tsunagi binaries, # using only dpkg-deb (no cargo-deb, no nfpm). # # Usage: build-deb.sh [tray_binary] @@ -38,6 +38,7 @@ install -D -m 0644 "$here/../../README.md" "$root/usr/share/doc/tsunagi/README.m install -D -m 0644 "$here/../linux/README.md" "$root/usr/share/doc/tsunagi/INSTALL.md" pkgname=tsunagi +depends="adduser" extra_control="" desc_gui="" if [ -n "$tray" ]; then @@ -46,7 +47,8 @@ if [ -n "$tray" ]; then # with it (both ship /usr/bin/tsng). extra_control=$'Conflicts: tsunagi\nReplaces: tsunagi\nProvides: tsunagi\n' # What the tray and its window load at run time. - extra_control+=$'Depends: libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxkbcommon0, libwayland-client0, libx11-6, libgl1\n' + glibc_min=$(bash "$here/../linux/required-glibc.sh" "$tray") + depends+=", libc6 (>= $glibc_min), libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxkbcommon0, libwayland-client0, libx11-6, libgl1" desc_gui=" It also installs the tray GUI (tsunagi-tray) and a desktop launcher so it can be started from the applications menu." install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" install -D -m 0644 "$here/../linux/tsunagi-tray.desktop" \ @@ -64,6 +66,7 @@ Architecture: ${arch} Maintainer: AB Section: net Priority: optional +Depends: ${depends} Homepage: https://github.com/house-of-vanity/tsunagi ${extra_control}Description: Serverless private mesh networking agent tsunagi forms small private mesh IP networks between peers, with NAT diff --git a/dist/linux/required-glibc.sh b/dist/linux/required-glibc.sh new file mode 100644 index 0000000..658e336 --- /dev/null +++ b/dist/linux/required-glibc.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Print the highest glibc symbol version imported by the Linux tray binary. +set -euo pipefail +export LC_ALL=C + +minimum=$(objdump -T "$1" | + sed -nE '/\*UND\*/s/.*GLIBC_([0-9]+(\.[0-9]+)+).*/\1/p' | + sort -V | tail -n 1) +if [[ -z "$minimum" ]]; then + echo "No versioned glibc imports found in $1" >&2 + exit 1 +fi +printf '%s\n' "$minimum"