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
On Tue, 06 Jan 2004 17:02:59 +0700, Michel Alexandre Salim wrote:
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.
Rather "ignored deliberately", because e.g. on Red Hat Linux <= 9 the --makefile-uninstall-rule option does not exist. One reason why I feel good when a packager decides to issue package updates only for FC1.
--
On Tue, 2004-01-06 at 18:08, Michael Schwendt wrote:
On Tue, 06 Jan 2004 17:02:59 +0700, Michel Alexandre Salim wrote:
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.
Rather "ignored deliberately", because e.g. on Red Hat Linux <= 9 the --makefile-uninstall-rule option does not exist. One reason why I feel good when a packager decides to issue package updates only for FC1.
Ah! Did not realize that. Will make it a point to do a fresh install when I upgrade my last (and only) RH9 server then.
- Michel
On Tue, 2004-01-06 at 05:02, Michel Alexandre Salim wrote:
Recommendations
- Add GConf install/uninstall examples to Fedora's spectemplate.spec
https://bugzilla.fedora.us/show_bug.cgi?id=1178
- Bugzilla the necessary packages
One could get the list of packages by rpm -qf'ing the .schemas files in /etc/gconf/schemas/
Yes, agreed, this is worthwhile.
Havoc