#!/bin/sh -e

LIBDIR=/usr/share/jed/jed-extra
FILES='-name *.slc'

# S-Lang script for setup, preparsing, and documentation generation
PREPARSE=/usr/share/jed/compile/jed-extra-preparse.sl

case "$1" in
  install)
      [ "$1" = install ] && jed-script $PREPARSE || true
      # don't worry if jed-script is missing, because jed runs this
      # script again at installation
      ;;
  remove)
      find $LIBDIR $FILES -print0 | xargs -0 --no-run-if-empty rm
      find $LIBDIR -type d -a -empty -print0 | xargs -0 --no-run-if-empty rmdir
      ;;
  *)
      echo "unknown argument --> \"$1"\" >&2
      exit 1
      ;;
esac
