#!/bin/sh -e

LIBDIR=/usr/share/jed/jed-extra
PREPARSE=/usr/share/jed/compile/jed-extra-preparse.sl

case "$1" in
  install)
	jed-script $PREPARSE || true
        # don't worry if jed-script is missing, because jed runs this scipt
        # again at installation
	;;
  remove)
        # option -delete requires findutils (>= 4.2.9) (not in sarge)
	# find $LIBDIR \( -name \*.slc -o -name \*.dfa \
        #                 -o -name ini.sl* -o -name libfuns.txt \) -delete
	find $LIBDIR \( -name \*.slc -o -name \*.dfa \
                        -o -name ini.sl* -o -name libfuns.* \) -print0 \
        | xargs -0 --no-run-if-empty rm
	;;
  *)
	echo "unknown argument --> \"$1"\" >&2
	exit 1
	;;
esac
