#!/bin/sh

case $2 in
POST-INSTALL)
	cd %%FONTSDIR%%
	touch fonts.dir
	sed -e '/-mikachan-/d' fonts.dir > fonts.dir.tmp
	numfonts=$(echo $(cat fonts.dir.tmp %%DIRFILE%% | wc -l) - 2 | bc)
	echo ${numfonts} > fonts.dir
	sed -e 1d fonts.dir.tmp >> fonts.dir
	sed -e 1d %%DIRFILE%% >> fonts.dir
	rm -f fonts.dir.tmp fonts.alias.tmp
;;
DEINSTALL)
	cd %%FONTSDIR%%
	touch fonts.dir
	sed -e '/-mikachan-/d' fonts.dir > fonts.dir.tmp
	numfonts=$(echo $(cat fonts.dir.tmp | wc -l) - 2 | bc)
	echo ${numfonts} > fonts.dir
	sed -e 1d fonts.dir.tmp >> fonts.dir
;;
esac
