diff options
Diffstat (limited to 'meta/classes/mime.bbclass')
-rw-r--r-- | meta/classes/mime.bbclass | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass deleted file mode 100644 index bb99bc35cb..0000000000 --- a/meta/classes/mime.bbclass +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | # | ||
2 | # This class is used by recipes installing mime types | ||
3 | # | ||
4 | |||
5 | DEPENDS += "${@bb.utils.contains('BPN', 'shared-mime-info', '', 'shared-mime-info', d)}" | ||
6 | PACKAGE_WRITE_DEPS += "shared-mime-info-native" | ||
7 | MIMEDIR = "${datadir}/mime" | ||
8 | |||
9 | mime_postinst() { | ||
10 | if [ "x$D" != "x" ]; then | ||
11 | $INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \ | ||
12 | mlprefix=${MLPREFIX} \ | ||
13 | mimedir=${MIMEDIR} | ||
14 | else | ||
15 | echo "Updating MIME database... this may take a while." | ||
16 | update-mime-database $D${MIMEDIR} | ||
17 | fi | ||
18 | } | ||
19 | |||
20 | mime_postrm() { | ||
21 | if [ "x$D" != "x" ]; then | ||
22 | $INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \ | ||
23 | mlprefix=${MLPREFIX} \ | ||
24 | mimedir=${MIMEDIR} | ||
25 | else | ||
26 | echo "Updating MIME database... this may take a while." | ||
27 | # $D${MIMEDIR}/packages belong to package shared-mime-info-data, | ||
28 | # packages like libfm-mime depend on shared-mime-info-data. | ||
29 | # after shared-mime-info-data uninstalled, $D${MIMEDIR}/packages | ||
30 | # is removed, but update-mime-database need this dir to update | ||
31 | # database, workaround to create one and remove it later | ||
32 | if [ ! -d $D${MIMEDIR}/packages ]; then | ||
33 | mkdir -p $D${MIMEDIR}/packages | ||
34 | update-mime-database $D${MIMEDIR} | ||
35 | rmdir --ignore-fail-on-non-empty $D${MIMEDIR}/packages | ||
36 | else | ||
37 | update-mime-database $D${MIMEDIR} | ||
38 | fi | ||
39 | fi | ||
40 | } | ||
41 | |||
42 | python populate_packages_append () { | ||
43 | packages = d.getVar('PACKAGES').split() | ||
44 | pkgdest = d.getVar('PKGDEST') | ||
45 | mimedir = d.getVar('MIMEDIR') | ||
46 | |||
47 | for pkg in packages: | ||
48 | mime_packages_dir = '%s/%s%s/packages' % (pkgdest, pkg, mimedir) | ||
49 | mimes_types_found = False | ||
50 | if os.path.exists(mime_packages_dir): | ||
51 | for f in os.listdir(mime_packages_dir): | ||
52 | if f.endswith('.xml'): | ||
53 | mimes_types_found = True | ||
54 | break | ||
55 | if mimes_types_found: | ||
56 | bb.note("adding mime postinst and postrm scripts to %s" % pkg) | ||
57 | postinst = d.getVar('pkg_postinst_%s' % pkg) | ||
58 | if not postinst: | ||
59 | postinst = '#!/bin/sh\n' | ||
60 | postinst += d.getVar('mime_postinst') | ||
61 | d.setVar('pkg_postinst_%s' % pkg, postinst) | ||
62 | postrm = d.getVar('pkg_postrm_%s' % pkg) | ||
63 | if not postrm: | ||
64 | postrm = '#!/bin/sh\n' | ||
65 | postrm += d.getVar('mime_postrm') | ||
66 | d.setVar('pkg_postrm_%s' % pkg, postrm) | ||
67 | if pkg != 'shared-mime-info-data': | ||
68 | bb.note("adding shared-mime-info-data dependency to %s" % pkg) | ||
69 | d.appendVar('RDEPENDS_' + pkg, " " + d.getVar('MLPREFIX')+"shared-mime-info-data") | ||
70 | } | ||