[recipes] Add a mimetype
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Add a mimetype
- Date: Thu, 9 Feb 2017 22:54:19 +0000 (UTC)
commit d016de904a82678e193a42ed42b16286ecc232a0
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Feb 9 07:36:52 2017 -0500
Add a mimetype
We are using application/vnd.gnome.recipes.export as
the mime type for our exported data, and the associated
extension .gnome-recipes-export.
data/Makefile.am | 23 +++++++++++++++++++++--
data/org.gnome.Recipes-mime.xml | 7 +++++++
2 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 176ca6a..131f21e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -22,6 +22,9 @@ dist_desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
EXTRA_DIST += $(desktop_in_files)
+mimedir = $(datadir)/mime/packages
+dist_mime_DATA = org.gnome.Recipes-mime.xml
+
ingredientsdir = $(pkgdatadir)/ingredients
imagesdir = $(pkgdatadir)/images
@@ -131,8 +134,8 @@ dist_appsiconsymbolic_DATA = \
update_icon_cache = gtk-update-icon-cache --ignore-theme-index --force
-install-data-hook: install-update-icon-cache
-uninstall-hook: uninstall-update-icon-cache
+install-data-hook: install-update-icon-cache install-update-mime-database
+uninstall-hook: uninstall-update-icon-cache uninstall-update-mime-database
install-update-icon-cache:
$(AM_V_at)$(POST_INSTALL)
@@ -142,6 +145,22 @@ uninstall-update-icon-cache:
$(AM_V_at)$(POST_UNINSTALL)
test -n "$(DESTDIR)" || $(update_icon_cache) "$(iconthemedir)"
+install-update-mime-database:
+ $(AM_V_at)$(POST_INSTALL)
+ if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
+ if which update-mime-database>/dev/null 2>&1; then \
+ update-mime-database $(DESTDIR)$(datadir)/mime; \
+ fi \
+ fi
+
+uninstall-update-mime-database:
+ $(AM_V_at)$(POST_UNINSTALL)
+ if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
+ if which update-mime-database>/dev/null 2>&1; then \
+ update-mime-database $(DESTDIR)$(datadir)/mime; \
+ fi \
+ fi
+
servicedir = $(datadir)/dbus-1/services
service_in_files = org.gnome.Recipes.service.in
dist_service_DATA = $(service_in_files:.service.in=.service)
diff --git a/data/org.gnome.Recipes-mime.xml b/data/org.gnome.Recipes-mime.xml
new file mode 100644
index 0000000..2e723b7
--- /dev/null
+++ b/data/org.gnome.Recipes-mime.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/vnd.gnome.recipes.export">
+ <comment>GNOME Recipes exported data</comment>
+ <glob pattern="*.gnome-recipes-export"/>
+ </mime-type>
+</mime-info>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]