update-rc.d: update package LICENSE
[openembedded.git] / classes / gconf.bbclass
blob30e7ef75911be77a27f74a9c0b361a03898374b3
1 DEPENDS += "gconf gconf-native"
3 gconf_postinst() {
4 if [ "$1" = configure ]; then
5         if [ "x$D" != "x" ]; then
6                 exit 1
7         fi
8         SCHEMA_LOCATION=/etc/gconf/schemas
9         for SCHEMA in ${SCHEMA_FILES}; do
10                 if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
11                         HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
12                                 gconftool-2 \
13                                 --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
14                 fi
15         done
19 gconf_prerm() {
20 if [ "$1" = remove ] || [ "$1" = upgrade ]; then
21         SCHEMA_LOCATION=/etc/gconf/schemas
22         for SCHEMA in ${SCHEMA_FILES}; do
23                 if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
24                         HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
25                                 gconftool-2 \
26                                         --makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
27                 fi
28         done
32 python populate_packages_append () {
33         import re
34         packages = bb.data.getVar('PACKAGES', d, 1).split()
35         pkgdest =  bb.data.getVar('PKGDEST', d, 1)
36         
37         for pkg in packages:
38                 schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
39                 schemas = []
40                 schema_re = re.compile(".*\.schemas$")
41                 if os.path.exists(schema_dir):
42                         for f in os.listdir(schema_dir):
43                                 if schema_re.match(f):
44                                         schemas.append(f)
45                 if schemas != []:
46                         bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
47                         bb.data.setVar('SCHEMA_FILES', " ".join(schemas), d)
48                         postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
49                         if not postinst:
50                                 postinst = '#!/bin/sh\n'
51                         postinst += bb.data.getVar('gconf_postinst', d, 1)
52                         bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
53                         prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1)
54                         if not prerm:
55                                 prerm = '#!/bin/sh\n'
56                         prerm += bb.data.getVar('gconf_prerm', d, 1)
57                         bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d)