summaryrefslogtreecommitdiff
path: root/mk/install/fonts
blob: 1ec70710f90206e9c936ebc11b002fbad37e4c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $NetBSD: fonts,v 1.6 2004/12/28 14:38:03 wiz Exp $
#
# Handle font databases; used by fonts.mk.
#

FONTS_TTF="@FONTS_TTF@"
FONTS_TTF_DIRS="@FONTS_TTF_DIRS@"
FONTS_TYPE1="@FONTS_TYPE1@"
FONTS_TYPE1_DIRS="@FONTS_TYPE1_DIRS@"
FONTS_X11="@FONTS_X11@"
FONTS_X11_DIRS="@FONTS_X11_DIRS@"
TTMKFDIR="@TTMKFDIR@"
TYPE1INST="@TYPE1INST@"
MKFONTDIR="@MKFONTDIR@"

case ${STAGE} in
POST-INSTALL|POST-DEINSTALL)
	${ECHO} "===> Updating font databases"
	if [ "${FONTS_TTF}" = "YES" ]; then
		for d in ${FONTS_TTF_DIRS}; do
			if [ -z "`cd $d ; ${LS} | ${GREP} -v .pkgsrc | ${GREP} -v ^fonts | ${GREP} -v ^Fontmap`" ]; then
				${RM} -f $d/fonts* $d/Fontmap*
			else
				( cd $d && ${TTMKFDIR} >/dev/null 2>&1 )
			fi
		done
	fi
	if [ "${FONTS_TYPE1}" = "YES" ]; then
		for d in ${FONTS_TYPE1_DIRS}; do
			if [ -z "`cd $d ; ${LS} | ${GREP} -v .pkgsrc | ${GREP} -v ^fonts | ${GREP} -v ^Fontmap`" ]; then
				${RM} -f $d/fonts* $d/Fontmap*
			else
				( cd $d && ${TYPE1INST} >/dev/null 2>&1 )
			fi
		done
	fi
	if [ "${FONTS_X11}" = "YES" ]; then
		for d in ${FONTS_X11_DIRS}; do
			if [ -z "`cd $d ; ${LS} | ${GREP} -v .pkgsrc | ${GREP} -v ^fonts | ${GREP} -v ^Fontmap`" ]; then
				${RM} -f $d/fonts* $d/Fontmap*
			else
				${MKFONTDIR} $d >/dev/null 2>&1
			fi
		done
	fi
	;;
esac