From 37cca4fc922c993960db9f76037b3194d7605af6 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 5 Jan 2012 20:05:44 -0800 Subject: [PATCH] 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. --- Makefile.am | 35 ++++++++++++++++++++++++++++- fen-viewer.desktop | 52 --------------------------------------------- pgn-viewer.desktop | 52 --------------------------------------------- xboard-fen-viewer.desktop | 52 +++++++++++++++++++++++++++++++++++++++++++++ xboard-pgn-viewer.desktop | 52 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 137 insertions(+), 106 deletions(-) delete mode 100644 fen-viewer.desktop delete mode 100644 pgn-viewer.desktop create mode 100644 xboard-fen-viewer.desktop create mode 100644 xboard-pgn-viewer.desktop 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/fen-viewer.desktop deleted file mode 100644 index 275792a..0000000 --- a/fen-viewer.desktop +++ /dev/null @@ -1,52 +0,0 @@ -[Desktop Entry] -Name=Xboard -Name[af]=X-bord -Name[ar]=Xboard -Name[bg]=Xboard -Name[bn]=এক্সবোর্ড -Name[cs]=Xboard -Name[da]=Xboard -Name[de]=Xboard -Name[el]=Xboard -Name[es]=Xboard -Name[et]=Xboard -Name[fi]=XBoard -Name[fr]=XBoard -Name[gl]=Xboard -Name[hi]=एक्सबोर्ड -Name[hr]=Xboard -Name[hu]=XBoard -Name[it]=XBoard -Name[ja]=Xboard -Name[km]=XBoard -Name[ko]=X보드 -Name[lt]=Xboard -Name[mr]=Xबोर्ड -Name[nb]=Xboard -Name[nl]=Xboard -Name[pa]=Xboard -Name[pl]=Xboard -Name[pt]=Xboard -Name[pt_BR]=Xboard -Name[ru]=Xboard -Name[sk]=Xboard -Name[sv]=Xboard -Name[ta]=பெயர்(எக்ஸ்போர்ட்.டெஸ்க்டாப்): எக்ஸ்போர்ட் -Name[th]=Xboard -Name[tr]=XBoard -Name[uk]=Xboard -Name[vi]=XBoard -Name[xh]=Ibhodi ye-X -Name[zh_CN]=X 国际象棋 -Name[zh_TW]=Xboard 國際象棋 -Name[zu]=I-Xboard -Comment=XBoard FEN display -GenericName=X-windows chess board -Type=Application -Categories=Game;BoardGame; -Exec=xboard -ncp -lpf %f -Icon=xboard -NoDisplay=true -Terminal=false -MimeType=application/x-chess-fen; - diff --git a/pgn-viewer.desktop b/pgn-viewer.desktop deleted file mode 100644 index 9c8ce54..0000000 --- a/pgn-viewer.desktop +++ /dev/null @@ -1,52 +0,0 @@ -[Desktop Entry] -Name=Xboard -Name[af]=X-bord -Name[ar]=Xboard -Name[bg]=Xboard -Name[bn]=এক্সবোর্ড -Name[cs]=Xboard -Name[da]=Xboard -Name[de]=Xboard -Name[el]=Xboard -Name[es]=Xboard -Name[et]=Xboard -Name[fi]=XBoard -Name[fr]=XBoard -Name[gl]=Xboard -Name[hi]=एक्सबोर्ड -Name[hr]=Xboard -Name[hu]=XBoard -Name[it]=XBoard -Name[ja]=Xboard -Name[km]=XBoard -Name[ko]=X보드 -Name[lt]=Xboard -Name[mr]=Xबोर्ड -Name[nb]=Xboard -Name[nl]=Xboard -Name[pa]=Xboard -Name[pl]=Xboard -Name[pt]=Xboard -Name[pt_BR]=Xboard -Name[ru]=Xboard -Name[sk]=Xboard -Name[sv]=Xboard -Name[ta]=பெயர்(எக்ஸ்போர்ட்.டெஸ்க்டாப்): எக்ஸ்போர்ட் -Name[th]=Xboard -Name[tr]=XBoard -Name[uk]=Xboard -Name[vi]=XBoard -Name[xh]=Ibhodi ye-X -Name[zh_CN]=X 国际象棋 -Name[zh_TW]=Xboard 國際象棋 -Name[zu]=I-Xboard -Comment=Run XBoard as PGN viewer -GenericName=X-windows chess board -Type=Application -Categories=Game;BoardGame; -Exec=xboard -viewer -lgf %f -Icon=xboard -NoDisplay=true -Terminal=false -MimeType=application/x-chess-pgn; - diff --git a/xboard-fen-viewer.desktop b/xboard-fen-viewer.desktop new file mode 100644 index 0000000..275792a --- /dev/null +++ b/xboard-fen-viewer.desktop @@ -0,0 +1,52 @@ +[Desktop Entry] +Name=Xboard +Name[af]=X-bord +Name[ar]=Xboard +Name[bg]=Xboard +Name[bn]=এক্সবোর্ড +Name[cs]=Xboard +Name[da]=Xboard +Name[de]=Xboard +Name[el]=Xboard +Name[es]=Xboard +Name[et]=Xboard +Name[fi]=XBoard +Name[fr]=XBoard +Name[gl]=Xboard +Name[hi]=एक्सबोर्ड +Name[hr]=Xboard +Name[hu]=XBoard +Name[it]=XBoard +Name[ja]=Xboard +Name[km]=XBoard +Name[ko]=X보드 +Name[lt]=Xboard +Name[mr]=Xबोर्ड +Name[nb]=Xboard +Name[nl]=Xboard +Name[pa]=Xboard +Name[pl]=Xboard +Name[pt]=Xboard +Name[pt_BR]=Xboard +Name[ru]=Xboard +Name[sk]=Xboard +Name[sv]=Xboard +Name[ta]=பெயர்(எக்ஸ்போர்ட்.டெஸ்க்டாப்): எக்ஸ்போர்ட் +Name[th]=Xboard +Name[tr]=XBoard +Name[uk]=Xboard +Name[vi]=XBoard +Name[xh]=Ibhodi ye-X +Name[zh_CN]=X 国际象棋 +Name[zh_TW]=Xboard 國際象棋 +Name[zu]=I-Xboard +Comment=XBoard FEN display +GenericName=X-windows chess board +Type=Application +Categories=Game;BoardGame; +Exec=xboard -ncp -lpf %f +Icon=xboard +NoDisplay=true +Terminal=false +MimeType=application/x-chess-fen; + diff --git a/xboard-pgn-viewer.desktop b/xboard-pgn-viewer.desktop new file mode 100644 index 0000000..9c8ce54 --- /dev/null +++ b/xboard-pgn-viewer.desktop @@ -0,0 +1,52 @@ +[Desktop Entry] +Name=Xboard +Name[af]=X-bord +Name[ar]=Xboard +Name[bg]=Xboard +Name[bn]=এক্সবোর্ড +Name[cs]=Xboard +Name[da]=Xboard +Name[de]=Xboard +Name[el]=Xboard +Name[es]=Xboard +Name[et]=Xboard +Name[fi]=XBoard +Name[fr]=XBoard +Name[gl]=Xboard +Name[hi]=एक्सबोर्ड +Name[hr]=Xboard +Name[hu]=XBoard +Name[it]=XBoard +Name[ja]=Xboard +Name[km]=XBoard +Name[ko]=X보드 +Name[lt]=Xboard +Name[mr]=Xबोर्ड +Name[nb]=Xboard +Name[nl]=Xboard +Name[pa]=Xboard +Name[pl]=Xboard +Name[pt]=Xboard +Name[pt_BR]=Xboard +Name[ru]=Xboard +Name[sk]=Xboard +Name[sv]=Xboard +Name[ta]=பெயர்(எக்ஸ்போர்ட்.டெஸ்க்டாப்): எக்ஸ்போர்ட் +Name[th]=Xboard +Name[tr]=XBoard +Name[uk]=Xboard +Name[vi]=XBoard +Name[xh]=Ibhodi ye-X +Name[zh_CN]=X 国际象棋 +Name[zh_TW]=Xboard 國際象棋 +Name[zu]=I-Xboard +Comment=Run XBoard as PGN viewer +GenericName=X-windows chess board +Type=Application +Categories=Game;BoardGame; +Exec=xboard -viewer -lgf %f +Icon=xboard +NoDisplay=true +Terminal=false +MimeType=application/x-chess-pgn; + -- 1.7.0.4