Add debianisation code and automatic build script
[wmaker-crm.git] / debian / wmaker.menu-method
1 #!/usr/bin/install-menu
2 #
3 # Generates Window Maker menus for all registered applications.
4
5 !include menu.h
6 compat="menu-1";
7 outputencoding="UTF-8"
8
9 genmenu="menu.hook"
10 rootprefix="/etc/X11/WindowMaker/"
11 userprefix=shell("echo -n /${GNUSTEP_USER_ROOT-GNUstep}") "/Library/WindowMaker/"
12 treewalk="(M)"
13 rootsection="/Debian"
14
15
16 function mytitle()=replacewith(title(),"\"","'")
17
18 function exec($action,$com)= \
19         "  \"" mytitle() "\" " ifnempty($shortcut, "SHORTCUT " $shortcut " ") $action " " esc($com,"*") "\n" 
20
21 supported
22 x11=    exec("SHEXEC",$command) 
23 wm=     exec("RESTART",$command) 
24 text=   exec("SHEXEC",term())
25 wmaker= exec("",$command ifnempty($arg," " $arg))
26 endsupported
27
28 preoutput= "/* Automatically generated file. Do not edit (see /usr/share/doc/menu/menu.txt.gz) */\n\n#include \"wmmacros\"\n"
29
30 mainmenutitle=""
31 submenutitle= ""
32
33 startmenu= "\n" \
34            ifelse( \
35                 title(), \
36                 "\"" mytitle() "\" MENU", \
37                 "Debian MENU\n\n#include <menu.prehook>" \
38            ) \
39            "\n"
40 endmenu=   ifelse( \
41                 title(), \
42                 "\"" mytitle() "\" END", \
43                 "\n#include <menu.posthook>\n\nDebian END" \
44            ) \
45            "\n"