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 + +