diff --git a/packaging/deb/postinst b/packaging/deb/postinst new file mode 100755 index 0000000..f3f5cd1 --- /dev/null +++ b/packaging/deb/postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -eu + +if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database -q /usr/share/applications || true +fi + +if command -v gtk-update-icon-cache >/dev/null 2>&1; then + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true +fi + +exit 0 diff --git a/packaging/linux/AppRun b/packaging/linux/AppRun index 80597d8..fd37ad0 100755 --- a/packaging/linux/AppRun +++ b/packaging/linux/AppRun @@ -10,4 +10,4 @@ export GST_PLUGIN_SYSTEM_PATH_1_0="$HERE/usr/lib/gstreamer-1.0" export WEBKIT_EXEC_PATH="$HERE/usr/lib/webkit2gtk-4.1" cd "$HERE/usr/bin" -exec "$HERE/usr/bin/verstak-desktop" "$@" +exec "$HERE/usr/bin/verstak" "$@" diff --git a/packaging/linux/verstak b/packaging/linux/verstak new file mode 100755 index 0000000..c4d068c --- /dev/null +++ b/packaging/linux/verstak @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +set -eu + +HERE="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +exec "$HERE/verstak-desktop" "$@" diff --git a/packaging/linux/verstak.desktop b/packaging/linux/verstak.desktop index 4afe4cb..7446a90 100644 --- a/packaging/linux/verstak.desktop +++ b/packaging/linux/verstak.desktop @@ -2,8 +2,10 @@ Type=Application Name=Verstak Comment=Local-first workspace -Exec=verstak-desktop %U +Exec=verstak %U Icon=verstak Terminal=false -Categories=Office;Utility; +Categories=Office; StartupNotify=true +X-Verstak-Desktop-Entry=true +X-AppImage-Name=Verstak diff --git a/scripts/package-appimage.sh b/scripts/package-appimage.sh index 67af611..6953f98 100755 --- a/scripts/package-appimage.sh +++ b/scripts/package-appimage.sh @@ -45,6 +45,7 @@ mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/lib" "$APPDIR/usr/share/applications" \ "$APPDIR/usr/share/icons/hicolor/scalable/apps" install -m 755 "$ROOT/packaging/linux/AppRun" "$APPDIR/AppRun" install -m 755 "$BUNDLE/verstak-desktop" "$APPDIR/usr/bin/verstak-desktop" +install -m 755 "$ROOT/packaging/linux/verstak" "$APPDIR/usr/bin/verstak" install -m 644 "$ROOT/packaging/linux/verstak.desktop" "$APPDIR/verstak.desktop" install -m 644 "$ROOT/packaging/linux/verstak.desktop" "$APPDIR/usr/share/applications/verstak.desktop" install -m 644 "$ROOT/packaging/linux/verstak.svg" "$APPDIR/verstak.svg" diff --git a/scripts/package-deb.sh b/scripts/package-deb.sh index 92aa425..f85ae69 100755 --- a/scripts/package-deb.sh +++ b/scripts/package-deb.sh @@ -28,6 +28,7 @@ mkdir -p "$STAGING/DEBIAN" "$STAGING/opt/verstak" "$STAGING/usr/bin" \ "$STAGING/usr/share/doc/verstak" sed "s/@VERSION@/$PACKAGE_VERSION/g" "$ROOT/packaging/deb/control" > "$STAGING/DEBIAN/control" +install -m 755 "$ROOT/packaging/deb/postinst" "$STAGING/DEBIAN/postinst" install -m 755 "$ROOT/packaging/deb/verstak" "$STAGING/usr/bin/verstak" install -m 755 "$BUNDLE/verstak-desktop" "$STAGING/opt/verstak/verstak-desktop" install -m 644 "$BUNDLE/README.md" "$BUNDLE/LICENSE" "$STAGING/usr/share/doc/verstak/" diff --git a/scripts/test-package-formats.sh b/scripts/test-package-formats.sh index 0ae0bf1..4863e02 100755 --- a/scripts/test-package-formats.sh +++ b/scripts/test-package-formats.sh @@ -15,6 +15,16 @@ done grep -Fq 'dpkg-deb' "$ROOT/scripts/package-deb.sh" grep -Fq -- '--build' "$ROOT/scripts/package-deb.sh" grep -Fq 'packaging/deb/control' "$ROOT/scripts/package-deb.sh" +grep -Fq 'packaging/deb/postinst' "$ROOT/scripts/package-deb.sh" +test -x "$ROOT/packaging/deb/postinst" +sh -n "$ROOT/packaging/deb/postinst" +grep -Fxq 'Exec=verstak %U' "$ROOT/packaging/linux/verstak.desktop" +grep -Fxq 'X-Verstak-Desktop-Entry=true' "$ROOT/packaging/linux/verstak.desktop" +grep -Fxq 'Categories=Office;' "$ROOT/packaging/linux/verstak.desktop" +grep -Fq 'update-desktop-database' "$ROOT/packaging/deb/postinst" +grep -Fq 'gtk-update-icon-cache' "$ROOT/packaging/deb/postinst" +grep -Fq 'packaging/linux/verstak' "$ROOT/scripts/package-appimage.sh" +grep -Fq 'usr/bin/verstak' "$ROOT/packaging/linux/AppRun" grep -Fq 'libwebkit2gtk-4.1-0' "$ROOT/packaging/deb/control" grep -Fq 'libayatana-appindicator3-1' "$ROOT/packaging/deb/control" grep -Fq 'appimagetool' "$ROOT/scripts/package-appimage.sh"