summaryrefslogtreecommitdiffstats
path: root/classes/mime.bbclass
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2010-11-02 11:11:31 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2010-11-02 11:11:31 +0100
commit2b60e0c68657a6867704e8b1869879df97ba63d9 (patch)
tree349906ac00c6cdcf21c64700e569782587c12268 /classes/mime.bbclass
parent8a3fda48e232073ecedb25e8b1136eeed78ca353 (diff)
downloadmeta-openembedded-2b60e0c68657a6867704e8b1869879df97ba63d9.tar.gz
angstrom-layers: add gnome classes from OE to meta-openembedded
mime.bbclass throws a python error, so the package splitting is disabled for the time being Signed-off-by: Koen Kooi <k-kooi@ti.com>
Diffstat (limited to 'classes/mime.bbclass')
-rw-r--r--classes/mime.bbclass56
1 files changed, 56 insertions, 0 deletions
diff --git a/classes/mime.bbclass b/classes/mime.bbclass
new file mode 100644
index 0000000000..b9cdd7becd
--- /dev/null
+++ b/classes/mime.bbclass
@@ -0,0 +1,56 @@
1DEPENDS += "shared-mime-info-native shared-mime-info"
2
3mime_postinst() {
4if [ "$1" = configure ]; then
5 if [ -x ${bindir}/update-mime-database ] ; then
6 echo "Updating MIME database... this may take a while."
7 update-mime-database $D${datadir}/mime
8 else
9 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
10 exit 1
11 fi
12fi
13}
14
15mime_postrm() {
16if [ "$1" = remove ] || [ "$1" = upgrade ]; then
17 if [ -x ${bindir}/update-mime-database ] ; then
18 echo "Updating MIME database... this may take a while."
19 update-mime-database $D${datadir}/mime
20 else
21 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
22 exit 1
23 fi
24fi
25}
26
27python ppopulate_packages_append () {
28 import os.path, re
29 packages = bb.data.getVar('PACKAGES', d, 1).split()
30 pkgdest = bb.data.getVar('PKGDEST', d, 1)
31
32 for pkg in packages:
33 mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
34 mimes = []
35 mime_re = re.compile(".*\.xml$")
36 if os.path.exists(mime_dir):
37 for f in os.listdir(mime_dir):
38 if mime_re.match(f):
39 mimes.append(f)
40 if mimes != []:
41 bb.note("adding mime postinst and postrm scripts to %s" % pkg)
42 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
43 if not postinst:
44 postinst = '#!/bin/sh\n'
45 postinst += bb.data.getVar('mime_postinst', d, 1)
46 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
47 postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
48 if not postrm:
49 postrm = '#!/bin/sh\n'
50 postrm += bb.data.getVar('mime_postrm', d, 1)
51 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
52 bb.note("adding freedesktop-mime-info dependency to %s" % pkg)
53 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
54 rdepends.append("freedesktop-mime-info")
55 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
56}