1 DEPENDS += "shared-mime-info-native shared-mime-info"
4 if [ "$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
9 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
16 if [ "$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
21 echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
27 python populate_packages_append () {
29 packages = bb.data.getVar('PACKAGES', d, 1).split()
30 pkgdest = bb.data.getVar('PKGDEST', d, 1)
33 mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
35 mime_re = re.compile(".*\.xml$")
36 if os.path.exists(mime_dir):
37 for f in os.listdir(mime_dir):
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)
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)
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)