From 0c66428868ffb74051e673263fcc8bbed0d5e20b Mon Sep 17 00:00:00 2001 From: Benjamin Trigona-Harany Date: Mon, 18 May 2020 00:21:43 -0700 Subject: [PATCH] games/VASSAL: Better desktop support. Signed-off-by: Benjamin Trigona-Harany Signed-off-by: Willy Sudiarto Raharjo --- games/VASSAL/VASSAL | 3 --- games/VASSAL/VASSAL-mime.xml | 27 +++++++++++++++++++++++++++ games/VASSAL/VASSAL.SlackBuild | 11 ++++++++--- games/VASSAL/VASSAL.desktop | 1 + games/VASSAL/doinst.sh | 10 ++++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) delete mode 100644 games/VASSAL/VASSAL create mode 100644 games/VASSAL/VASSAL-mime.xml diff --git a/games/VASSAL/VASSAL b/games/VASSAL/VASSAL deleted file mode 100644 index 2f833e3399..0000000000 --- a/games/VASSAL/VASSAL +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/games/VASSAL -./VASSAL.sh diff --git a/games/VASSAL/VASSAL-mime.xml b/games/VASSAL/VASSAL-mime.xml new file mode 100644 index 0000000000..9ce2e12f9c --- /dev/null +++ b/games/VASSAL/VASSAL-mime.xml @@ -0,0 +1,27 @@ + + + + + VASSAL module + + + + + + VASSAL module extension + + + + + + VASSAL game log + + + + + + VASSAL saved game + + + + diff --git a/games/VASSAL/VASSAL.SlackBuild b/games/VASSAL/VASSAL.SlackBuild index 8fabf966a7..ade48ceb0f 100644 --- a/games/VASSAL/VASSAL.SlackBuild +++ b/games/VASSAL/VASSAL.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=VASSAL VERSION=${VERSION:-3.2.17} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -72,12 +72,16 @@ find -L . \ mkdir -p $PKG/usr/bin $PKG/usr/share/games/$PRGNAM cp -rf lib $PKG/usr/share/games/$PRGNAM -install -D -m0755 $PRGNAM.sh $PKG/usr/share/games/$PRGNAM/$PRGNAM.sh -install -D -m0755 $CWD/VASSAL $PKG/usr/bin +sed -i "s|^\(INSTALL_DIR=\).*|\1/usr/share/games/$PRGNAM|" $PRGNAM.sh + +install -D -m0755 $PRGNAM.sh $PKG/usr/bin/$PRGNAM mkdir -p $PKG/usr/share/applications install -D -m644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop +mkdir -p $PKG/usr/share/mime/packages +install -D -m644 $CWD/$PRGNAM-mime.xml $PKG/usr/share/mime/packages/$PRGNAM-mime.xml + mkdir -p $PKG/usr/share/pixmaps install -m644 -D $CWD/$PRGNAM.svg $PKG/usr/share/pixmaps/$PRGNAM.svg @@ -86,6 +90,7 @@ cp -a \ CHANGES LICENSE README doc \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +rm $PKG/usr/doc/$PRGNAM-$VERSION/doc/userguide/userguide.doc ln -s /usr/doc/$PRGNAM-$VERSION/doc $PKG/usr/share/games/$PRGNAM/doc mkdir -p $PKG/install diff --git a/games/VASSAL/VASSAL.desktop b/games/VASSAL/VASSAL.desktop index 54e0241956..53988fad6c 100644 --- a/games/VASSAL/VASSAL.desktop +++ b/games/VASSAL/VASSAL.desktop @@ -7,3 +7,4 @@ Terminal=false Type=Application Categories=Game GenericName=Board and card game engine +MimeType=application/x-vnd.vassalengine.module;application/x-vnd.vassalengine.module-extension;application/x-vnd.vassalengine.game-log;application/x-vnd.vassalengine.saved-game diff --git a/games/VASSAL/doinst.sh b/games/VASSAL/doinst.sh index 5fb28930db..aea0f894eb 100644 --- a/games/VASSAL/doinst.sh +++ b/games/VASSAL/doinst.sh @@ -1,3 +1,13 @@ if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi