2013-03-05 16:15:13 +00:00
|
|
|
#!/bin/sh
|
2010-11-04 12:53:46 +00:00
|
|
|
#
|
|
|
|
# This trigger rebuilds the fonts.dir and fonts.scale files
|
|
|
|
# for packages that install X11 fonts, and update fontconfig's
|
|
|
|
# cache for those fonts.
|
|
|
|
#
|
|
|
|
# Arguments: $ACTION = [run/targets]
|
|
|
|
# $TARGET = [post-install/pre-remove]
|
|
|
|
# $PKGNAME
|
|
|
|
# $VERSION
|
|
|
|
# $UPDATE = [yes/no]
|
|
|
|
#
|
|
|
|
ACTION="$1"
|
|
|
|
TARGET="$2"
|
|
|
|
PKGNAME="$3"
|
|
|
|
VERSION="$4"
|
|
|
|
UPDATE="$5"
|
|
|
|
|
2011-07-01 13:22:10 +00:00
|
|
|
export PATH="$PATH:/usr/local/bin"
|
|
|
|
|
2010-11-04 12:53:46 +00:00
|
|
|
mkfontdir=usr/bin/mkfontdir
|
|
|
|
mkfontscale=usr/bin/mkfontscale
|
|
|
|
fccache=usr/bin/fc-cache
|
|
|
|
|
|
|
|
case "$ACTION" in
|
|
|
|
targets)
|
2013-01-29 09:25:54 +00:00
|
|
|
echo "post-install post-remove"
|
2010-11-04 12:53:46 +00:00
|
|
|
;;
|
|
|
|
run)
|
|
|
|
if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ -z "${font_dirs}" ] && exit 0
|
|
|
|
|
|
|
|
case "$TARGET" in
|
2013-01-29 09:25:54 +00:00
|
|
|
post-install|post-remove)
|
2010-11-04 12:53:46 +00:00
|
|
|
for dir in ${font_dirs}; do
|
|
|
|
echo "Building ${dir}/fonts.dir..."
|
2013-01-29 09:25:54 +00:00
|
|
|
${mkfontdir} .${dir}
|
2010-11-04 12:53:46 +00:00
|
|
|
echo "Building ${dir}/fonts.scale..."
|
2013-01-29 09:25:54 +00:00
|
|
|
${mkfontscale} .${dir}
|
2010-11-04 12:53:46 +00:00
|
|
|
echo "Updating fontconfig's cache..."
|
2013-03-05 16:22:21 +00:00
|
|
|
${fccache} -f .${dir}
|
2010-11-04 12:53:46 +00:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|