1 |
commit: 3bdcae62e9f5c435e8f566c333f6ca01a7cdb21e |
2 |
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 21 10:31:29 2015 +0000 |
4 |
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 24 21:56:16 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bdcae62 |
7 |
|
8 |
xdg.eclass: initial commit |
9 |
|
10 |
Goal of this eclass is to end the inconsistent and often forgotten use |
11 |
of fdo-mime.eclass. Provides all needed phases for proper behavior. |
12 |
|
13 |
https://bugs.gentoo.org/show_bug.cgi?id=208047 |
14 |
|
15 |
eclass/xdg.eclass | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
16 |
1 file changed, 61 insertions(+) |
17 |
|
18 |
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass |
19 |
new file mode 100644 |
20 |
index 0000000..799d6a2 |
21 |
--- /dev/null |
22 |
+++ b/eclass/xdg.eclass |
23 |
@@ -0,0 +1,61 @@ |
24 |
+# Copyright 1999-2015 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+# $Id$ |
27 |
+ |
28 |
+# @ECLASS: xdg.eclass |
29 |
+# @MAINTAINER: |
30 |
+# freedesktop-bugs@g.o |
31 |
+# @AUTHOR: |
32 |
+# Original author: Gilles Dartiguelongue <eva@g.o> |
33 |
+# @BLURB: Provides phases for XDG compliant packages. |
34 |
+# @DESCRIPTION: |
35 |
+# Utility eclass to update the desktop and shared mime info as laid |
36 |
+# out in the freedesktop specs & implementations |
37 |
+ |
38 |
+inherit xdg-utils |
39 |
+ |
40 |
+case "${EAPI:-0}" in |
41 |
+ 4|5|6) |
42 |
+ EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm |
43 |
+ ;; |
44 |
+ *) die "EAPI=${EAPI} is not supported" ;; |
45 |
+esac |
46 |
+ |
47 |
+DEPEND=" |
48 |
+ dev-util/desktop-file-utils |
49 |
+ x11-misc/shared-mime-info |
50 |
+" |
51 |
+ |
52 |
+# @FUNCTION: xdg_src_prepare |
53 |
+# @DESCRIPTION: |
54 |
+# Prepare sources to work with XDG standards. |
55 |
+xdg_src_prepare() { |
56 |
+ xdg_environment_reset |
57 |
+ |
58 |
+ has ${EAPI:-0} 6 && eapply_user |
59 |
+} |
60 |
+ |
61 |
+# @FUNCTION: xdg_pkg_preinst |
62 |
+# @DESCRIPTION: |
63 |
+# Finds .desktop and mime info files for later handling in pkg_postinst |
64 |
+xdg_pkg_preinst() { |
65 |
+ xdg_desktopfiles_savelist |
66 |
+ xdg_mimeinfo_savelist |
67 |
+} |
68 |
+ |
69 |
+# @FUNCTION: xdg_pkg_postinst |
70 |
+# @DESCRIPTION: |
71 |
+# Handle desktop and mime info database updates. |
72 |
+xdg_pkg_postinst() { |
73 |
+ xdg_desktop_database_update |
74 |
+ xdg_mimeinfo_database_update |
75 |
+} |
76 |
+ |
77 |
+# @FUNCTION: xdg_pkg_postrm |
78 |
+# @DESCRIPTION: |
79 |
+# Handle desktop and mime info database updates. |
80 |
+xdg_pkg_postrm() { |
81 |
+ xdg_desktop_database_update |
82 |
+ xdg_mimeinfo_database_update |
83 |
+} |
84 |
+ |