$OpenBSD: patch-scripts_xdg-desktop-menu,v 1.2 2012/04/09 09:39:15 ajacoutot Exp $
--- scripts/xdg-desktop-menu.orig	Sat Jan  1 11:03:14 2011
+++ scripts/xdg-desktop-menu	Mon Apr  9 10:46:52 2012
@@ -665,7 +665,7 @@ make_lazy_default()
 
     for MIME in $mimetypes ; do
         xdg_default_dirs="$XDG_DATA_DIRS"
-        [ -n "$xdg_default_dirs" ] || xdg_default_dirs=/usr/local/share/:/usr/share/
+        [ -n "$xdg_default_dirs" ] || xdg_default_dirs=${LOCALBASE}/share/:/usr/share/
         if [ x"$mode" = x"user" ] ; then
             xdg_user_dir="$XDG_DATA_HOME"
             [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
@@ -708,7 +708,7 @@ update_submenu()
     xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
 
     xdg_system_dirs="$XDG_CONFIG_DIRS"
-    [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/etc/xdg
+    [ -n "$xdg_system_dirs" ] || xdg_system_dirs=${SYSCONFDIR}/xdg
     xdg_global_dir=
     for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
         if [ -w $x/$xdg_dir_name ] ; then
@@ -756,7 +756,7 @@ update_submenu()
         return
     fi
 
-    if [ $action = "install" -a -f "/etc/xdg/menus/gnome-applications.menu" ] ; then
+    if [ $action = "install" -a -f "${SYSCONFDIR}/xdg/menus/gnome-applications.menu" ] ; then
         # Work around for Debian Gnome
         gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-applications-merged^'`
         if [ ! -e "$gnome_xdg_dir" ] ; then
@@ -774,7 +774,7 @@ update_submenu()
             eval 'ln -s "applications-merged" "$mandrake_xdg_dir"'$xdg_redirect_output
         fi
     fi
-    if [ $action = "install" -a x"$mode" = x"user" -a -d "/etc/xdg/menus/kde-applications-merged" ] ; then
+    if [ $action = "install" -a x"$mode" = x"user" -a -d "${SYSCONFDIR}/xdg/menus/kde-applications-merged" ] ; then
         # Work around for Fedora Core 5 + patched KDE
         kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'`
         if [ ! -e "$kde_xdg_dir" ] ; then
@@ -783,7 +783,7 @@ update_submenu()
             eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_output
         fi
     fi
-    if [ $action = "install" -a x"$mode" = x"system" -a -d "/etc/xdg/menus/kde-applications-merged" -a ! -d "/etc/xdg/menus/applications-merged" ] ; then
+    if [ $action = "install" -a x"$mode" = x"system" -a -d "${SYSCONFDIR}/xdg/menus/kde-applications-merged" -a ! -d "${SYSCONFDIR}/xdg/menus/applications-merged" ] ; then
         # Work around for Kubuntu 6.06
         kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'`
         DEBUG 1 "Kubuntu Workaround: Link '$xdg_dir' to 'kde-applications-merged'"
@@ -1071,7 +1071,7 @@ xdg_user_dir="$XDG_DATA_HOME"
 xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
 
 xdg_system_dirs="$XDG_DATA_DIRS"
-[ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+[ -n "$xdg_system_dirs" ] || xdg_system_dirs=${LOCALBASE}/share/:/usr/share/
 xdg_global_dir=
 for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
     if [ -w $x/$xdg_dir_name ] ; then
@@ -1138,7 +1138,7 @@ xdg_user_dir="$XDG_DATA_HOME"
 xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
 
 xdg_system_dirs="$XDG_DATA_DIRS"
-[ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+[ -n "$xdg_system_dirs" ] || xdg_system_dirs=${LOCALBASE}/share/:/usr/share/
 xdg_global_dir=
 for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
     if [ -w $x/$xdg_dir_name ] ; then
@@ -1152,7 +1152,7 @@ kde_global_dir=`kde${KDE_SESSION_VERSION}-config --pat
 [ -w $kde_global_dir ] || kde_global_dir=
 
 gnome_user_dir="$HOME/.gnome/apps"
-gnome_global_dir="/usr/share/gnome/apps"
+gnome_global_dir="${LOCALBASE}/share/gnome/apps"
 [ -w $gnome_global_dir ] || gnome_global_dir=
 
 DEBUG 3 "Install locations for *.desktop files:"
