From 343ecffd7b2225ba3ff66ff0985851948e258351 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Mon, 13 Feb 2012 22:29:48 -0800 Subject: [PATCH 1/1] add configure test for xdg-programs to install mime types; can be disabled for building of e.g. rpms in case the target system doesn't have the xdg-programs available, we test for them. Distributions often have their own macros to install these, so we add an enable option to configure --- Makefile.am | 4 ++-- configure.ac | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 88df0b9..3f0e37d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -174,7 +174,7 @@ xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi 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;\ @@ -185,7 +185,7 @@ install-mime-database: 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;\ diff --git a/configure.ac b/configure.ac index 52c7946..37bae05 100644 --- a/configure.ac +++ b/configure.ac @@ -416,6 +416,14 @@ X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXmu -lX11 -lXt " 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]) -- 1.7.0.4