freebsd-ports/vietnamese/unicode-uhoai/pkg-deinstall
John Marino 2dd72908d0 vietnamese/unicode-uhoai: Fix deinstall and add stage support
This port had a few problems:
 * The package list tried to remove the wrong directory
 * The pkg-install script installs font.dir and font.scale files but
   never tries to remove them.  This causes orphan checks to fail
 * The EXTRACTS_BEFORE_ARGS may not be additive (don't use +=)
 * The EXTRACTS_BEFORE_ARGS definition came after <bsd.port.mk> so it
   was never seen anyway
 * The latter may mean that the font never installed properly if the
   file didn't get transformed to lower case.

After staging, I added a pkg-deinstall script.  I'm not 100% sure it's
correct if there are more than one Truetype font installed, but it's a
lot better than it was and it removes the font.* stuff upon deinstall.
This passes testport in poudriere.
2014-05-30 23:16:06 +00:00

13 lines
231 B
Bash

#!/bin/sh
# $FreeBSD$
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
cd ${PKG_PREFIX}/lib/X11/fonts/TrueType
${PKG_PREFIX}/bin/ttmkfdir -o fonts.scale
if [ `cat fonts.scale` = "0" ]; then
rm -f fonts.scale
rm -f fonts.dir
fi