summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-12-18 10:28:40 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-12-18 14:20:39 +0100
commitabf13d38b3cf27d3aa04f25419488dcde3dd5bfa (patch)
tree08155c3abb6a8fe2abf785939814947335328d3a /data
parent8ae2199aa74dbec3e1b729a89f3578e078f60c6b (diff)
downloadvirt-viewer-abf13d38b3cf27d3aa04f25419488dcde3dd5bfa.tar.gz
virt-viewer-abf13d38b3cf27d3aa04f25419488dcde3dd5bfa.tar.xz
virt-viewer-abf13d38b3cf27d3aa04f25419488dcde3dd5bfa.zip
Update shared mime database on install/uninstall
remomte-viewer installs a file to $datadir/share/mime to register a mime-type for its .vv files. However, after installing this file, update-mime-database must be run in order to update the shared mime database. This commit (inspired by what Nautilus/planner are doing) adds what is needed for that. If the mime type is not correctly registered, gvfs-info console.vv will not return the correct mime type, and xdg-open console.vv will fail to start remote-viewer, and will fall back to running gedit as the .vv file is a text file. https://bugzilla.redhat.com/show_bug.cgi?id=1044209
Diffstat (limited to 'data')
-rw-r--r--data/Makefile.am12
1 files changed, 12 insertions, 0 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index a43374e..086efca 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -63,6 +63,18 @@ mimedir = $(datadir)/mime/packages
mime_DATA = virt-viewer-mime.xml
@INTLTOOL_XML_RULE@
+install-data-hook:
+if ENABLE_UPDATE_MIMEDB
+ @if $(AM_V_P); then set -x; else echo " INSTALL update-mime-database"; fi; \
+ $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime";
+endif
+
+uninstall-hook:
+if ENABLE_UPDATE_MIMEDB
+ @if $(AM_V_P); then set -x; else echo " UNINSTALL update-mime-database"; fi; \
+ $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime";
+endif
+
CLEANFILES += $(mime_DATA) $(desktop_DATA)
EXTRA_DIST += $(MIMEFILES) $(DESKTOPFILES)