From: Stefan Reinauer Date: Thu, 4 Jun 2026 15:00:19 +0000 (-0700) Subject: packaging: add Debian install hooks X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=470143bf8049f65e4f921349690a6b1d0af7446f;p=francis%2Fwinuae.git packaging: add Debian install hooks Add Debian maintainer hooks for registering and removing desktop MIME metadata. This keeps package installs integrated with the desktop environment without requiring users to run update commands manually. --- diff --git a/.gitignore b/.gitignore index ddf100eb..a187b804 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ decompress *.recipe packages packages.config +/.deps/ *.sqlite *.db-shm *.db-wal diff --git a/packaging/debian/postinst b/packaging/debian/postinst new file mode 100755 index 00000000..a1f994f7 --- /dev/null +++ b/packaging/debian/postinst @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +if [ "$1" = "configure" ]; then + if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database -q /usr/share/applications || true + fi + if command -v update-mime-database >/dev/null 2>&1; then + update-mime-database /usr/share/mime || 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 +fi + +exit 0 diff --git a/packaging/debian/postrm b/packaging/debian/postrm new file mode 100755 index 00000000..d36625f0 --- /dev/null +++ b/packaging/debian/postrm @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +case "$1" in + remove|purge) + if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database -q /usr/share/applications || true + fi + if command -v update-mime-database >/dev/null 2>&1; then + update-mime-database /usr/share/mime || 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 + ;; +esac + +exit 0