]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
packaging: add Debian install hooks
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Thu, 4 Jun 2026 15:00:19 +0000 (08:00 -0700)
committerStefan <stefan.reinauer@coreboot.org>
Sun, 14 Jun 2026 04:50:59 +0000 (21:50 -0700)
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.

.gitignore
packaging/debian/postinst [new file with mode: 0755]
packaging/debian/postrm [new file with mode: 0755]

index ddf100eb52c7914af90194c7984407d9302678aa..a187b80419abed65178192af7948c26f2b6d11a8 100644 (file)
@@ -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 (executable)
index 0000000..a1f994f
--- /dev/null
@@ -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 (executable)
index 0000000..d36625f
--- /dev/null
@@ -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