Register shared Linux CLI links with deb lifecycle management for 0.2.4
This commit is contained in:
1 parent
dc8edf0df6
commit
3c6c4a0e90
11 files changed
+242
-19
No files matched your search
@@ -36,9 +36,21 @@ package() {
|
||||
for tool in ads-agent ads-client adsctl ads-usb ads-server ads-relay; do
|
||||
if [[ -f "$payload/$tool" ]]; then check_elf "$payload/$tool"; chmod 755 "$payload/$tool"; fi
|
||||
done
|
||||
printf '#!/bin/sh\nexec /opt/ttstd/%s/%s "$@"\n' "$name" "$exe" > "$tree/usr/bin/$name"
|
||||
chmod 755 "$tree/usr/bin/$name"
|
||||
if [[ "$kind" == agent ]]; then ln -s /opt/ttstd/ads-agent/adsctl "$tree/usr/bin/adsctl"; fi
|
||||
if [[ "$kind" != agent ]]; then
|
||||
printf '#!/bin/sh\nexec /opt/ttstd/%s/%s "$@"\n' "$name" "$exe" > "$tree/usr/bin/$name"
|
||||
chmod 755 "$tree/usr/bin/$name"
|
||||
fi
|
||||
if [[ "$kind" == avalonia || "$kind" == flutter || "$kind" == agent ]]; then
|
||||
case "$kind" in agent) priority=80;; avalonia) priority=60;; flutter) priority=50;; esac
|
||||
for hook in postinst prerm postrm; do
|
||||
sed -e "s/@PACKAGE@/$name/g" -e "s/@PRIORITY@/$priority/g" -e "s/@HOOK@/$hook/g" "$root/deploy/deb-cli-links.sh" > "$tree/DEBIAN/$hook"
|
||||
chmod 755 "$tree/DEBIAN/$hook"
|
||||
done
|
||||
# Old agent packages owned /usr/bin/adsctl and /usr/bin/ads-agent directly.
|
||||
# Re-register after dpkg removes those legacy files during upgrade/removal.
|
||||
printf 'interest-noawait /usr/bin/adsctl\ninterest-noawait /usr/bin/ads-agent\n' > "$tree/DEBIAN/triggers"
|
||||
chmod 644 "$tree/DEBIAN/triggers"
|
||||
fi
|
||||
if [[ "$kind" == server ]]; then ln -s /opt/ttstd/ads-server/ads-relay "$tree/usr/bin/ads-relay"; fi
|
||||
if [[ "$kind" == avalonia || "$kind" == flutter ]]; then
|
||||
mkdir -p "$tree/usr/share/applications" "$tree/usr/share/icons/hicolor/256x256/apps"
|
||||
|
||||
Reference in new issue
Block a user