From 13de2746eac2ce16120ac7e81e997e80ece485ce Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sat, 7 Jun 2008 13:31:18 +0000 Subject: [PATCH] loki-setup: use xdg-desktop-menu instead of loki-setup legacy menu entries --- misc/setup/doit | 4 ++++ misc/setup/install-desktop-files.sh | 14 ++++++++++++++ misc/setup/ioquake3.desktop | 9 +++++++++ misc/setup/preuninstall.sh | 8 ++++++++ misc/setup/setup.xml.in | 12 ++++++++++++ 5 files changed, 47 insertions(+) create mode 100755 misc/setup/install-desktop-files.sh create mode 100644 misc/setup/ioquake3.desktop mode change 100644 => 100755 misc/setup/preuninstall.sh diff --git a/misc/setup/doit b/misc/setup/doit index 834cff90..be5a2791 100755 --- a/misc/setup/doit +++ b/misc/setup/doit @@ -96,6 +96,10 @@ fi ### uninstall script install -m 755 ./preuninstall.sh image/preuninstall.sh +# desktop file handling +install -m 755 ./install-desktop-files.sh image/install-desktop-files.sh +install -m 755 /usr/bin/xdg-desktop-menu image/xdg-desktop-menu +install -m 644 ioquake3.desktop image/ioquake3.desktop.in ### README, COPYING and EULA install -m 644 $topdir/README image/README diff --git a/misc/setup/install-desktop-files.sh b/misc/setup/install-desktop-files.sh new file mode 100755 index 00000000..5bcb411e --- /dev/null +++ b/misc/setup/install-desktop-files.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +if ! test -e "$SETUP_INSTALLPATH"/ioquake3.desktop.in; then + exit 0 +fi +xdg_desktop_menu=`which xdg-desktop-menu 2>/dev/null` +if test "x$xdg_desktop_menu" = x; then + xdg_desktop_menu=./xdg-desktop-menu +fi +sed -e "s#^Exec=.*#Exec=$SETUP_INSTALLPATH/ioquake3#" \ + -e "s#^Icon=.*#Icon=$SETUP_INSTALLPATH/quake3.png#" \ + < $SETUP_INSTALLPATH/ioquake3.desktop.in \ + > $SETUP_INSTALLPATH/ioquake3.desktop +$xdg_desktop_menu install --novendor $SETUP_INSTALLPATH/ioquake3.desktop diff --git a/misc/setup/ioquake3.desktop b/misc/setup/ioquake3.desktop new file mode 100644 index 00000000..0ccff3ad --- /dev/null +++ b/misc/setup/ioquake3.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=ioquake3 +Exec=ioquake3 +Icon=quake3 +Type=Application +Terminal=false +Encoding=UTF-8 +Categories=Game;ActionGame; +X-SuSE-translate=false diff --git a/misc/setup/preuninstall.sh b/misc/setup/preuninstall.sh old mode 100644 new mode 100755 index 49e80564..e6a413d2 --- a/misc/setup/preuninstall.sh +++ b/misc/setup/preuninstall.sh @@ -1,2 +1,10 @@ #!/bin/sh rmdir --ignore-fail-on-non-empty demoq3 missionpack >& /dev/null +if test -e "$SETUP_INSTALLPATH"/ioquake3.desktop.in; then + xdg_desktop_menu=`which xdg-desktop-menu 2>/dev/null` + if test "x$xdg_desktop_menu" = x; then + xdg_desktop_menu=./xdg-desktop-menu + fi + $xdg_desktop_menu uninstall --novendor ioquake3.desktop + rm ioquake3.desktop +fi diff --git a/misc/setup/setup.xml.in b/misc/setup/setup.xml.in index 65dd1b9d..a74cb982 100644 --- a/misc/setup/setup.xml.in +++ b/misc/setup/setup.xml.in @@ -6,6 +6,8 @@ promptbinaries="yes" reinstall="yes" nopromptoverwrite="yes" + nomenuitems="yes" + postinstall="install-desktop-files.sh" preuninstall="preuninstall.sh"> README @@ -42,6 +44,16 @@ ifelse(HAVE_PPC,yes,dnl you need the binaries to play the game )dnl + +