summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes/mime.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/classes/mime.bbclass')
-rw-r--r--meta-oe/classes/mime.bbclass58
1 files changed, 0 insertions, 58 deletions
diff --git a/meta-oe/classes/mime.bbclass b/meta-oe/classes/mime.bbclass
deleted file mode 100644
index d73c2cb11..000000000
--- a/meta-oe/classes/mime.bbclass
+++ /dev/null
@@ -1,58 +0,0 @@
1DEPENDS += "shared-mime-info-native shared-mime-info"
2
3EXTRA_OECONF += "--disable-update-mimedb"
4
5mime_postinst() {
6if [ "$1" = configure ]; then
7 if [ -x ${bindir}/update-mime-database ] ; then
8 echo "Updating MIME database... this may take a while."
9 update-mime-database $D${datadir}/mime
10 else
11 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
12 exit 1
13 fi
14fi
15}
16
17mime_postrm() {
18if [ "$1" = remove ] || [ "$1" = upgrade ]; then
19 if [ -x ${bindir}/update-mime-database ] ; then
20 echo "Updating MIME database... this may take a while."
21 update-mime-database $D${datadir}/mime
22 else
23 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
24 exit 1
25 fi
26fi
27}
28
29python ppopulate_packages_append () {
30 import os.path, re
31 packages = bb.data.getVar('PACKAGES', d, 1).split()
32 pkgdest = bb.data.getVar('PKGDEST', d, 1)
33
34 for pkg in packages:
35 mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
36 mimes = []
37 mime_re = re.compile(".*\.xml$")
38 if os.path.exists(mime_dir):
39 for f in os.listdir(mime_dir):
40 if mime_re.match(f):
41 mimes.append(f)
42 if mimes != []:
43 bb.note("adding mime postinst and postrm scripts to %s" % pkg)
44 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
45 if not postinst:
46 postinst = '#!/bin/sh\n'
47 postinst += bb.data.getVar('mime_postinst', d, 1)
48 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
49 postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
50 if not postrm:
51 postrm = '#!/bin/sh\n'
52 postrm += bb.data.getVar('mime_postrm', d, 1)
53 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
54 bb.note("adding freedesktop-mime-info dependency to %s" % pkg)
55 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
56 rdepends.append("freedesktop-mime-info")
57 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
58}