From: Arun Persaud Date: Fri, 6 Jan 2012 04:05:44 +0000 (-0800) Subject: added desktop and mime-type association to autoconf install process X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=37cca4fc922c993960db9f76037b3194d7605af6;p=xboard.git added desktop and mime-type association to autoconf install process This should install and uninstall the mime assocciation and also the icons. Also renamed the desktop files to avoid possible name collisions. --- diff --git a/Makefile.am b/Makefile.am index 480ff70..d479217 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,8 +67,12 @@ dist_svgicon_DATA = xboard.svg ### desktop files for KDE and gnome Applicationsdir = $(datadir)/applications -Applications_DATA = xboard.desktop +Applications_DATA = xboard.desktop xboard-fen-viewer.desktop \ + xboard-pgn-viewer.desktop xboard-tourney.desktop +### mime definitions for association of fen, png and tourney files +Mimedir = $(datadir)/mime/packages +Mime_DATA = xboard.xml ### directory and files for bitmaps @@ -142,7 +146,9 @@ dist_bitmaps_DATA = \ ### directory and files for pixmaps pixmapsdir = $(datadir)/games/xboard/pixmaps/textures -dist_pixmaps_DATA = pixmaps/wood_d.xpm pixmaps/wood_l.xpm +dist_pixmaps_DATA = pixmaps/wood_d.xpm pixmaps/wood_l.xpm \ + pixmaps/cross32.xpm pixmaps/cross48.xpm \ + pixmaps/board32.xpm pixmaps/board48.xpm ### directory and files for sound files @@ -171,3 +177,28 @@ distclean-local: xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false) + +install-data-hook: install-mime-database +uninstall-hook: uninstall-mime-database +install-mime-database: + @-if test -z "$(DESTDIR)"; then \ + xdg-mime install --mode system --novendor $(Mimedir)/xboard.xml ;\ + xdg-desktop-menu install --mode system --novendor $(Applicationsdir)/xboard-pgn-viewer.desktop;\ + xdg-desktop-menu install --mode system --novendor $(Applicationsdir)/xboard-fen-viewer.desktop;\ + xdg-desktop-menu install --mode system --novendor $(Applicationsdir)/xboard-tourney.desktop;\ + xdg-icon-resource install --context mimetypes --size 32 $(pixmapsdir)/board32.xpm application-x-chess-pgn;\ + xdg-icon-resource install --context mimetypes --size 32 $(pixmapsdir)/cross32.xpm x-xboard-pgn;\ + xdg-icon-resource install --context mimetypes --size 48 $(pixmapsdir)/board48.xpm application-x-chess-pgn;\ + xdg-icon-resource install --context mimetypes --size 48 $(pixmapsdir)/cross48.xpm x-xboard-pgn;\ + fi +uninstall-mime-database: + @-if test -z "$(DESTDIR)"; then \ + xdg-mime uninstall --mode system --novendor xboard.xml;\ + xdg-desktop-menu uninstall --mode system --novendor xboard-pgn-viewer.desktop;\ + xdg-desktop-menu uninstall --mode system --novendor xboard-fen-viewer.desktop;\ + xdg-desktop-menu uninstall --mode system --novendor xboard-tourney.desktop;\ + xdg-icon-resource uninstall --context mimetypes --size 32 board32.xpm application-x-chess-pgn;\ + xdg-icon-resource uninstall --context mimetypes --size 32 cross32.xpm x-xboard-pgn;\ + xdg-icon-resource uninstall --context mimetypes --size 48 board48.xpm application-x-chess-pgn;\ + xdg-icon-resource uninstall --context mimetypes --size 48 cross48.xpm x-xboard-pgn;\ + fi \ No newline at end of file diff --git a/fen-viewer.desktop b/xboard-fen-viewer.desktop similarity index 100% rename from fen-viewer.desktop rename to xboard-fen-viewer.desktop diff --git a/pgn-viewer.desktop b/xboard-pgn-viewer.desktop similarity index 100% rename from pgn-viewer.desktop rename to xboard-pgn-viewer.desktop