#!/usr/sbin/install-menu
#   -*- mode: shell-script; -*-
#
# Written by Jan Wagemakers
# Thanks to Thomas Leonard for advice about "$@" and symlink /usr/share/doc
#
compat="menu-1"
!include menu.h
genmenu="roxmenu"
rootprefix="/etc/"
onlyrunasroot=true

# Some text to go at the top of the autogenerated file.
preoutput="#!/bin/sh \n# ROX menu \n\n"

# In what order we output the menus.
treewalk="c(m)"

# How to start a new menu in the rc file.
startmenu="\n"

supported
x11= "mkdir -p \"/usr/share/apps"$section"\"\n" \
     "echo \"#!/bin/sh\" > \"/usr/share/apps"$section"/AppRun\"\n" \
     "echo \"# Generated by /etc/menu-methods/rox : do not edit \"" \
     " >> \"/usr/share/apps"$section"/AppRun\"\n" \
     "echo \""$command" \\\"\\\$@\\\"\" >> \"/usr/share/apps"$section"/AppRun\"\n" \
     "ln -s /usr/share/doc/ \"/usr/share/apps"$section"/Help\"\n" \
     "chmod 755 \"/usr/share/apps"$section"/AppRun\"\n" \
     "if test -e \""$icon"\"\n" \
     "then \n" \
     "cp \""$icon"\" \"/usr/share/apps" $section "/AppIcon.xpm\"\n" \
     "fi \n\n"
endsupported
# Experimental Help-symlink. Replace the line 
# "ln -s /usr/share/doc/ \"/usr/share/apps"$section"/Help\"\n" \ above with this
# if you want to use it.
#     "if test -e \""$command"\"\n" \
#     "then \n" \
#     "ln -s /usr/share/doc/`dpkg -S "$command" | cut -d: -f1` " \
#     "\"/usr/share/apps"$section"/Help\"\n" \
#     "fi \n\n" \	

endmenu= "\n"

# Command to run at end.
postrun="mkdir -p /usr/share/apps/Debian ; rm -r /usr/share/apps/Debian ; " \
        ". /etc/roxmenu ; rm /etc/roxmenu"
	


