Integrate G15 submodules with Debian 13 packaging and devcontainer
This commit is contained in:
commit
795db7924b
28 files changed
+714
No files matched your search
@@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
# Destructive package lifecycle checks, only in a disposable container.
|
||||
set -euo pipefail
|
||||
export LC_ALL=C
|
||||
[[ -f /.dockerenv && $EUID == 0 ]] || exit 1
|
||||
out=$(realpath "${1:?artifact directory required}")
|
||||
cd "$out"
|
||||
sha256sum -c SHA256SUMS
|
||||
packages=(libg15-1 libg15-dev libg15render1 libg15render-dev g15daemon libg15daemon-client1t64 libg15daemon-client-dev g15macro)
|
||||
distro=()
|
||||
for package in "${packages[@]}"; do
|
||||
files=("${package}"_*.deb)
|
||||
[[ ${#files[@]} == 1 && -f ${files[0]} ]]
|
||||
[[ $(dpkg-deb -f "${files[0]}" Package) == "$package" ]]
|
||||
candidate=$(apt-cache madison "$package" | awk 'NR == 1 {print $3}')
|
||||
if [[ -n $candidate ]]; then
|
||||
dpkg --compare-versions "$(dpkg-deb -f "${files[0]}" Version)" gt "$candidate"
|
||||
distro+=("$package=$candidate")
|
||||
else
|
||||
[[ $package == g15macro ]] || exit 1
|
||||
echo 'g15macro has no trixie candidate; fresh installation only.'
|
||||
fi
|
||||
done
|
||||
lintian --fail-on error ./*.changes
|
||||
scratch=$(mktemp -d)
|
||||
trap 'rm -rf "$scratch"' EXIT
|
||||
multiarch=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
libraries=(libg15 libg15render libg15daemon_client)
|
||||
mapfile -t allpackages < <(for deb in ./*.deb; do dpkg-deb -f "$deb" Package; done)
|
||||
purge() {
|
||||
local package
|
||||
local -a installed=()
|
||||
for package in "${allpackages[@]}"; do
|
||||
if dpkg-query -W -f='${db:Status-Status}' "$package" 2>/dev/null | grep -qx installed; then
|
||||
installed+=("$package")
|
||||
fi
|
||||
done
|
||||
if ((${#installed[@]})); then apt-get purge -y "${installed[@]}"; fi
|
||||
}
|
||||
smoke() {
|
||||
local package files
|
||||
for package in "${packages[@]}"; do
|
||||
files=("${package}"_*.deb)
|
||||
[[ $(dpkg-query -W -f='${Version}' "$package") == "$(dpkg-deb -f "${files[0]}" Version)" ]]
|
||||
done
|
||||
for binary in /usr/sbin/g15daemon /usr/bin/g15macro; do
|
||||
ldd "$binary" > "$scratch/ldd"
|
||||
cat "$scratch/ldd"
|
||||
if grep -q 'not found' "$scratch/ldd"; then exit 1; fi
|
||||
done
|
||||
for library in "${libraries[@]}"; do
|
||||
readelf -d "/usr/lib/$multiarch/$library.so.1" | grep "SONAME.*$library.so.1"
|
||||
done
|
||||
test -f /usr/lib/systemd/system/g15daemon.service
|
||||
grep -q c22b /usr/lib/udev/rules.d/*g15daemon.rules
|
||||
printf '#include <libg15.h>\n#include <libg15render.h>\n#include <g15daemon_client.h>\nint main(void) { g15canvas c; g15r_initCanvas(&c); return g15daemon_version() == 0; }\n' | \
|
||||
cc -x c - -Wl,--no-as-needed -lg15 -lg15render -lg15daemon_client -o "$scratch/client-smoke"
|
||||
"$scratch/client-smoke"
|
||||
/usr/bin/g15macro --version
|
||||
/usr/bin/g15macro --help
|
||||
}
|
||||
purge
|
||||
apt-get install -y ./*.deb
|
||||
smoke
|
||||
purge
|
||||
apt-get install -y "${distro[@]}"
|
||||
for library in "${libraries[@]}"; do
|
||||
nm -D --defined-only "/usr/lib/$multiarch/$library.so.1" | awk '{print $3}' | sort > "$scratch/$library.before"
|
||||
done
|
||||
apt-get install -y ./*.deb
|
||||
for library in "${libraries[@]}"; do
|
||||
nm -D --defined-only "/usr/lib/$multiarch/$library.so.1" | awk '{print $3}' | sort > "$scratch/$library.after"
|
||||
comm -23 "$scratch/$library.before" "$scratch/$library.after" > "$scratch/$library.missing"
|
||||
test ! -s "$scratch/$library.missing" || { cat "$scratch/$library.missing"; exit 1; }
|
||||
done
|
||||
version=$(dpkg-query -W -f='${Version}' libg15daemon-client1t64)
|
||||
[[ $(dpkg-query -W -f='${Replaces}' libg15daemon-client1t64) == libg15daemon-client1 ]]
|
||||
[[ $(dpkg-query -W -f='${Breaks}' libg15daemon-client1t64) == "libg15daemon-client1 (<< $version)" ]]
|
||||
# amd64 retains the old ABI; dpkg generates architecture-dependent t64 Provides.
|
||||
if [[ $(dpkg --print-architecture) == amd64 ]]; then
|
||||
[[ $(dpkg-query -W -f='${Provides}' libg15daemon-client1t64) == "libg15daemon-client1 (= $version)" ]]
|
||||
fi
|
||||
smoke
|
||||
purge
|
||||
test ! -e /usr/lib/systemd/system/g15daemon.service
|
||||
echo 'PASS: fresh install, distro upgrade, symbols, linking, t64 metadata and purge; no hardware I/O.'
|
||||
Reference in new issue
Block a user