#!/usr/sbin/install-menu
# freedesktop desktop entry spec - directory generation
# http://www.freedesktop.org/Standards/desktop-entry-spec
# Copyright 2004 - Chris Cheney
# Licensed under the GNU General Public License, version 2.

compat="menu-1"

!include menu.h

compat="menu-2"

function DirEntry() =
	"[Desktop Entry]\n"
	"Type=Directory\n"
	"Encoding=UTF-8\n"
	"Name=" title() "\n"
	"Icon=" ifelse($icon,$icon,"altlinux") "\n"
	forall(languages(), "lang", "Name[" substr($lang, "0", "2") "]=" encode_translate($lang,title(), "utf8") "\n")
	ifelse($xdg_extra, $xdg_extra "\n", ifnempty($extra_opt, $extra_opt "\n"))
	ifneq(toupper($needs), "X11", ifneq(toupper($needs), "TEXT", "OnlyShowIn=" toupper($needs) ";\n"));

#outputencoding="UTF-8";

supported;
 gnome = ;
 kde = ;
 x11 = ;
 text = ;
endsupported;

startmenu = "";
endmenu = "";
submenutitle = DirEntry();

treewalk = "M";

genmenu = ifempty($command,tolower( "alt" replacewith($section,"/ .","---") ".directory"));
removemenu = "rm -rf " prefix()"/alt-* "prefix()"/kde-* "prefix()"/gnome-* ";

rootsection = "";

prerun = "rm -rf " prefix()"/alt-* "prefix()"/kde-* "prefix()"/gnome-* ";
postrun = "ln -sf /usr/share/desktop-directories/altlinux-main.directory " prefix()"/alt.directory";

preoutput = "";

rootprefix = "/var/cache/desktop-directories";

userprefix = ".local/share/desktop-directories";
