Installation and removal of GConf schemas via RPM

Michel Alexandre Salim salimma1 at yahoo.co.uk
Tue Jan 6 10:02:59 UTC 2004


Abstract
--------
Controlling installation and removal of GConf schemas from RPM spec
files

Introduction
------------

GConf-enabled applications present a unique challenge to packagers,
having to do with the nature of GConf itself. The most appropriate
comparison is with Windows' registry, with applications shipping with a
.schemas file (equivalent to .reg) listing GConf keypairs that have to
be installed into the system's GConf tree when the package is installed,
and uninstalled when the package is removed.

Current situation
-----------------
Vendor-supplied Makefiles call gconf-install-tool as part of the
'install' target, and the following line, put under the %install section
of the .spec file before 'make install' prevents this as schemas should
not be installed at this time:

export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1

With some Makefiles GConf schema installation has to be disabled before
%build's make as well; YMMV.

Schemas are installed during %post, with a typical procedure as follows:

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
        %{_sysconfdir}/gconf/schemas/straw.schemas >/dev/null

Problem
-------

So far so good. It is uninstalling that packagers have, unfortunately,
tended to ignore, as I discovered when packaging my first GConf-enabled
app. Leaving GConf keys behind is messy and could pose potential
compatibility problems when newer versions of applications are
installed, and should be discouraged. The uninstall process itself is
happily quite easy to perform:

%preun
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
        %{_sysconfdir}/gconf/schemas/straw.schemas >/dev/null

This has to be done in %preun instead of %postun since at the latter
stage, the .schemas file would have been already erased.

Recommendations
---------------

1. Add GConf install/uninstall examples to Fedora's spectemplate.spec
https://bugzilla.fedora.us/show_bug.cgi?id=1178

2. Bugzilla the necessary packages
One could get the list of packages by rpm -qf'ing the .schemas files in
/etc/gconf/schemas/

Hopefully this could be sorted by the time FC2 ships.

Regards,

Michel





More information about the fedora-devel-list mailing list