freebsd-ports/japanese/font-shinonome/files/pkg-install.in
Hiroki Sato 1c3480236a - Add missing dependency.
- Fix typo in PKG{,DE}INSTALL line.
- Remove ^!! line from fonts.alias.
- Use POST-DEINSTALL instead of DEINSTALL because mkfontdir(1) is
  used for generating fonts.dir.
2009-05-31 13:03:28 +00:00

43 lines
1.1 KiB
Bash

#!/bin/sh
# $FreeBSD$
X_FONTSDIR=%%X_FONTSDIR%%
case "$2" in
POST-INSTALL)
%%LOCALBASE%%/bin/fc-cache -s -f -v ${X_FONTSDIR}/misc
cd ${X_FONTSDIR}/misc
%%LOCALBASE%%/bin/mkfontdir ${X_FONTSDIR}/misc
touch fonts.alias
grep -v -- "-shinonome-" fonts.alias > fonts.alias.tmp
(cat fonts.alias.tmp; grep -v "^!!" %%FONTSALIAS%%) > fonts.alias
rm -f fonts.alias.tmp
;;
POST-DEINSTALL)
%%LOCALBASE%%/bin/fc-cache -f -v ${X_FONTSDIR}/misc
rm -f ${X_FONTSDIR}/misc/fonts.cache-1
cd ${X_FONTSDIR}/misc
%%LOCALBASE%%/bin/mkfontdir ${X_FONTSDIR}/misc
if [ -r ${X_FONTSDIR}/misc/fonts.dir -a `/usr/bin/wc -l < ${X_FONTSDIR}/misc/fonts.dir` = 1 ]; then
rm -f ${X_FONTSDIR}/misc/fonts.dir
fi
touch fonts.alias
grep -v -- "-shinonome-" fonts.alias > fonts.alias.tmp
if [ -s fonts.alias.tmp ]; then
mv fonts.alias.tmp fonts.alias
else
rm -f fonts.alias.tmp fonts.alias
fi
for D in misc
do
rmdir ${X_FONTSDIR}/${D} > /dev/null 2>&1 || true
if [ -d ${X_FONTSDIR}/${D} ]; then
%%LOCALBASE%%/bin/fc-cache -s -f -v ${X_FONTSDIR}/${D} || true
fi
done
;;
esac