Hi Bill,
dh-cruft is a debhelper addon used extensively by the Games Team
to register the highscore files stored in /var/games/.
It does what the manually written postrm did and a bit more.
Here's for example the result for toppler:
$ cat debian/toppler/DEBIAN/postrm
#!/bin/sh
set -e
# Automatically added by dh_cruft/0.9.80
if [ "$1" = "purge" ]
then
# we need to glob, so no quotes
rm -rf ${DPKG_ROOT:-}/var/games/toppler/
if test -d ${DPKG_ROOT:-}/var/games/
then
rmdir --ignore-fail-on-non-empty ${DPKG_ROOT:-}/var/games/
fi
fi
# End automatically added section
# Automatically added by dh_installmenu/13.31
if [ -x "`command -v update-menus`" ] && [ -x "$DPKG_ROOT`command -v update-menus`" ]; then update-menus ; fi
# End automatically added section
As a side-effect dh-cruft also register these volatiles files in the database
used by cruft-ng to know which files belong to which package;
but if you don't use cruft this won't be of interrest to you I guess.
Greetings
Alexandre
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,8 @@ Source: toppler
Section: games
Priority: optional
Maintainer: Bill Allombert <ballombe@debian.org>
-Build-Depends: debhelper-compat (= 13), libsdl2-dev, libsdl2-mixer-dev, libsdl2-image-dev:native, zlib1g-dev, libpng-dev
+Build-Depends: debhelper-compat (= 13), dh-sequence-cruft,
+ libsdl2-dev, libsdl2-mixer-dev, libsdl2-image-dev:native, zlib1g-dev, libpng-dev
Rules-Requires-Root: no
Standards-Version: 4.7.0
Homepage: https://gitlab.com/roever/toppler/
--- /dev/null
+++ b/debian/toppler.purge
@@ -0,0 +1 @@
+/var/games/toppler/
--- a/debian/postrm
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# postrm script for #PACKAGE#
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postrm> `remove'
-# * <postrm> `purge'
-# * <old-postrm> `upgrade' <new-version>
-# * <new-postrm> `failed-upgrade' <old-version>
-# * <new-postrm> `abort-install'
-# * <new-postrm> `abort-install' <old-version>
-# * <new-postrm> `abort-upgrade' <old-version>
-# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
-# for details, see /usr/share/doc/packaging-manual/
-
-case "$1" in
- purge)
- rm -rf /var/games/toppler
- ;;
-
- remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-
-
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 0
-
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-