#1135839 moria: please use dh-cruft to register & clean /var/games/moria/

Package:
moria
Source:
moria
Description:
Rogue-like game with an infinite dungeon, also known as umoria
Submitter:
Alexandre Detiste
Date:
2026-06-01 07:13:01 UTC
Severity:
normal
#1135839#5
Date:
2026-05-06 13:13:45 UTC
From:
To:
Hi Phil,

Please include this small patch that translates the open-code moria.postrm
script into a machine-readable moria.purge.

This way /var/games/ get handled with the latest best practices
without having to bother you again later.

I also appended the generated "debian/moria/DEBIAN/postrm"
so you can peek an eye on it.

Greetings

Alexandre
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: moria
 Section: games
 Priority: optional
 Maintainer: Phil Brooke <pjb@debian.org>
-Build-Depends: debhelper (>= 13~), libncurses-dev, sharutils, cmake
+Build-Depends: debhelper (>= 13~), dh-sequence-cruft, libncurses-dev, sharutils, cmake
 Rules-Requires-Root: binary-targets
 Standards-Version: 4.5.0
 Homepage: https://umoria.org/
--- a/debian/moria.postrm
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-# Originally shamelessly stolen from Joey Hess' bsdgames-2.12-9
-
-SCORESFILE="/var/games/moria/scores.dat"
-
-# Remove high score files on purge.
-if [ "$1" = "purge" ]; then
-       rm -f $SCORESFILE
-       rmdir /var/games/moria /var/games 2>/dev/null || true
-fi
-
-#DEBHELPER#
--- /dev/null
+++ b/debian/moria.purge
@@ -0,0 +1 @@
+/var/games/moria/
----------------------------------- #!/bin/sh set -e # Automatically added by dh_installdeb/13.31 dpkg-maintscript-helper rm_conffile /etc/moria-hours 5.7.10\+20181022-2\~ -- "$@" # End automatically added section # 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/moria/ 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
#1135839#10
Date:
2026-06-01 07:10:47 UTC
From:
To:
Good morning, Alexandre,

Thank you for the suggestion!  I'll incorporate it in the next few days.

Cheers,

Phil.