kde-plasma/breeze-gtk: x86 stable wrt bug #613144
[gentoo.git] / eclass / fdo-mime.eclass
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: fdo-mime.eclass
5 # @MAINTAINER:
6 # freedesktop-bugs@gentoo.org
7 # @AUTHOR:
8 # Original author: foser <foser@gentoo.org>
9 # @BLURB: Utility eclass to update the desktop mime info as laid out in the freedesktop specs & implementations
10
11 # @FUNCTION: fdo-mime_desktop_database_update
12 # @DESCRIPTION:
13 # Updates the desktop database.
14 # Generates a list of mimetypes linked to applications that can handle them
15 fdo-mime_desktop_database_update() {
16         has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
17         has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
18         if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
19         then
20                 einfo "Updating desktop mime database ..."
21                 "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/applications"
22         fi
23 }
24
25 # @FUNCTION: fdo-mime_mime_database_update
26 # @DESCRIPTION:
27 # Update the mime database.
28 # Creates a general list of mime types from several sources
29 fdo-mime_mime_database_update() {
30         has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
31         has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
32         if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
33         then
34                 einfo "Updating shared mime info database ..."
35                 "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"
36         fi
37 }