#!/bin/sh

CLEAN=0

if test "$1" = "CLEAN" ; then
    shift
    CLEAN=1
fi

for i in $@ ; do
    if test "$CLEAN" = "1" ; then
        rm -f xemacs@MAJVERSION@@SUBNAME@-$i.menu.in
    else
        ( echo "?package(xemacs@MAJVERSION@-$i):\\"
          echo "  needs=\"X11\"\\"
          echo "  section=\"Applications/Editors\"\\"
          echo "  title=\"XEmacs@MAJVERSION@-$i\"\\"
          echo "  command=\"/usr/bin/xemacs@MAJVERSION@-$i\"\\"
          echo "  hints=\"Text\""
          echo ""
          echo "?package(xemacs@MAJVERSION@-$i):\\"
          echo "  needs=\"text\"\\"
          echo "  section=\"Applications/Editors\"\\"
          echo "  title=\"XEmacs@MAJVERSION@-$i\"\\"
          echo "  command=\"/usr/bin/xemacs@MAJVERSION@-$i -nw\"\\"
          echo "  hints=\"Text\""
          echo ""
        ) > xemacs@MAJVERSION@@SUBNAME@-$i.menu.in
    fi
done

