Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | DEPENDS += "gconf" |
| 2 | PACKAGE_WRITE_DEPS += "gconf-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 3 | |
| 4 | # These are for when gconftool is used natively and the prefix isn't necessarily |
| 5 | # the sysroot. TODO: replicate the postinst logic for -native packages going |
| 6 | # into sysroot as they won't be running their own install-time schema |
| 7 | # registration (disabled below) nor the postinst script (as they don't happen). |
| 8 | export GCONF_SCHEMA_INSTALL_SOURCE = "xml:merged:${STAGING_DIR_NATIVE}${sysconfdir}/gconf/gconf.xml.defaults" |
| 9 | export GCONF_BACKEND_DIR = "${STAGING_LIBDIR_NATIVE}/GConf/2" |
| 10 | |
| 11 | # Disable install-time schema registration as we're a packaging system so this |
| 12 | # happens in the postinst script, not at install time. Set both the configure |
| 13 | # script option and the traditional envionment variable just to make sure. |
| 14 | EXTRA_OECONF += "--disable-schemas-install" |
| 15 | export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL = "1" |
| 16 | |
| 17 | gconf_postinst() { |
| 18 | if [ "x$D" != "x" ]; then |
| 19 | export GCONF_CONFIG_SOURCE="xml::$D${sysconfdir}/gconf/gconf.xml.defaults" |
| 20 | else |
| 21 | export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` |
| 22 | fi |
| 23 | |
| 24 | SCHEMA_LOCATION=$D/etc/gconf/schemas |
| 25 | for SCHEMA in ${SCHEMA_FILES}; do |
| 26 | if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then |
| 27 | HOME=$D/root gconftool-2 \ |
| 28 | --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null |
| 29 | fi |
| 30 | done |
| 31 | } |
| 32 | |
| 33 | gconf_prerm() { |
| 34 | SCHEMA_LOCATION=/etc/gconf/schemas |
| 35 | for SCHEMA in ${SCHEMA_FILES}; do |
| 36 | if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then |
| 37 | HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ |
| 38 | gconftool-2 \ |
| 39 | --makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null |
| 40 | fi |
| 41 | done |
| 42 | } |
| 43 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | python populate_packages:append () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | import re |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 46 | packages = d.getVar('PACKAGES').split() |
| 47 | pkgdest = d.getVar('PKGDEST') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | |
| 49 | for pkg in packages: |
| 50 | schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg) |
| 51 | schemas = [] |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 52 | schema_re = re.compile(r".*\.schemas$") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | if os.path.exists(schema_dir): |
| 54 | for f in os.listdir(schema_dir): |
| 55 | if schema_re.match(f): |
| 56 | schemas.append(f) |
| 57 | if schemas != []: |
| 58 | bb.note("adding gconf postinst and prerm scripts to %s" % pkg) |
| 59 | d.setVar('SCHEMA_FILES', " ".join(schemas)) |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | postinst = d.getVar('pkg_postinst:%s' % pkg) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | if not postinst: |
| 62 | postinst = '#!/bin/sh\n' |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 63 | postinst += d.getVar('gconf_postinst') |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 64 | d.setVar('pkg_postinst:%s' % pkg, postinst) |
| 65 | prerm = d.getVar('pkg_prerm:%s' % pkg) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | if not prerm: |
| 67 | prerm = '#!/bin/sh\n' |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 68 | prerm += d.getVar('gconf_prerm') |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | d.setVar('pkg_prerm:%s' % pkg, prerm) |
| 70 | d.appendVar("RDEPENDS:%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | } |