void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

x11-fonts (951B)


      1#!/bin/sh
      2#
      3# This trigger rebuilds the fonts.dir and fonts.scale files
      4# for packages that install X11 fonts, and update fontconfig's
      5# cache for those fonts.
      6#
      7# Arguments:	$ACTION = [run/targets]
      8#		$TARGET = [post-install/pre-remove]
      9#		$PKGNAME
     10#		$VERSION
     11#		$UPDATE = [yes/no]
     12#
     13ACTION="$1"
     14TARGET="$2"
     15PKGNAME="$3"
     16VERSION="$4"
     17UPDATE="$5"
     18
     19mkfontdir=usr/bin/mkfontdir
     20mkfontscale=usr/bin/mkfontscale
     21fccache=usr/bin/fc-cache
     22
     23case "$ACTION" in
     24targets)
     25	echo "post-install post-remove"
     26	;;
     27run)
     28	if [ ! -x $mkfontdir ]; then
     29		exit 0
     30	fi
     31
     32	if [ ! -x $mkfontscale ]; then
     33		exit 0
     34	fi
     35
     36	[ -z "${font_dirs}" ] && exit 0
     37
     38	case "$TARGET" in
     39	post-install|post-remove)
     40		for dir in ${font_dirs}; do
     41			echo "Building ${dir}/fonts.dir..."
     42			${mkfontdir} .${dir}
     43			echo "Building ${dir}/fonts.scale..."
     44			${mkfontscale} .${dir}
     45			echo "Updating fontconfig's cache..."
     46			${fccache} -f .${dir}
     47		done
     48		;;
     49	esac
     50
     51	;;
     52*)
     53	exit 1
     54	;;
     55esac
     56
     57exit 0