install-data-hook: install-mime-database
uninstall-hook: uninstall-mime-database
install-mime-database:
- @-if test -z "$(DESTDIR)"; then \
+ -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
xdg-mime install --mode system --novendor xboard.xml ;\
xdg-desktop-menu install --mode system --novendor xboard-pgn-viewer.desktop;\
xdg-desktop-menu install --mode system --novendor xboard-fen-viewer.desktop;\
xdg-icon-resource install --context mimetypes --size 48 pixmaps/cross48.xpm application-x-xboard-trn;\
fi
uninstall-mime-database:
- @-if test -z "$(DESTDIR)"; then \
+ -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; 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;\
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
+dnl | can we install desktop icons and mime associations?
+AC_PATH_PROG([XDG_MIME],[xdg-mime])
+AC_SUBST(XDG_MIME)
+AC_PATH_PROG([XDG_DESKTOP_MENU],[xdg-desktop-menu])
+AC_SUBST(XDG_DESKTOP_MENU)
+AC_PATH_PROG([XDG_ICON_RESOURCE],[xdg-icon-resource])
+AC_SUBST(XDG_ICON_RESOURCE)
+
AC_CONFIG_FILES([Makefile cmail po/Makefile.in])
AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h])