#!/bin/sh -e

if [ "$1" = "configure" ]; then

  update-alternatives --install /usr/bin/editor editor /usr/bin/joe 70 \
    --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/joe.1.gz
  update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/joerc 70
  update-alternatives --install /usr/bin/editor editor /usr/bin/jmacs 50 \
    --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jmacs.1.gz
  update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jmacsrc 50
  update-alternatives --install /usr/bin/editor editor /usr/bin/jstar 50 \
    --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jstar.1.gz
  update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jstarrc 50
  update-alternatives --install /usr/bin/editor editor /usr/bin/jpico 50 \
    --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jpico.1.gz
  update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jpicorc 50
  update-alternatives --install /usr/bin/editor editor /usr/bin/rjoe 25 \
    --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/rjoe.1.gz
  update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/rjoerc 25

  if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi

fi
