Re: gconf schema



Christophe Fergeau <teuf users sourceforge net> writes:
> 
> I'm currently porting galeon to gconf and I'm having some difficulties with
> schema files. I have a schema file which should set the default values for
> all galeon's prefs, but I don't manage to get a correct makefile rule to
> install a schema which would be available for all the users : currently,
> I'm using 
> gconftool --makefile-install-rule $(top_srcdir)/galeon.schema
> in my makefiles, but it only installs the schema for the user who runs make
> install.
> 
> Can anyone help me with that ?
> 

Sure - you need to set up the config source. GConf itself has an
example. There are two main steps I would do:

 - allow forcing a config source via configure.in, and have a default
 - use that in the Makefile

So configure.in:

 dnl Specify the configuration source, default to xml::$(sysconfdir)/gconf/gconf.xml.defaults

GCONF_CONFIG_SOURCE=
AC_ARG_ENABLE(gconf-source, 
            [  --enable-gconf-source=sourceaddress      Where to install schema files.],GCONF_CONFIG_SOURCE=$enable_gconf_source,)

if test "x$GCONF_CONFIG_SOURCE" = "x"; then
        GCONF_CONFIG_SOURCE="xml::\${sysconfdir}/gconf/gconf.xml.defaults"
        INSTALL_GCONF_CONFIG_SOURCE="xml::\$(DESTDIR)\${sysconfdir}/gconf/gconf.xml.defaults"
        AC_FYI("Using default config source $GCONF_CONFIG_SOURCE for schema installation")
else
        AC_FYI("Using config source $GCONF_CONFIG_SOURCE for schema installation")
fi

AC_SUBST(GCONF_CONFIG_SOURCE)
AC_SUBST(INSTALL_GCONF_CONFIG_SOURCE)

Makefile.am:

schemadir=$(sysconfdir)/gconf/schemas
schema_DATA=desktop.schemas

EXTRA_DIST=$(schema_DATA)

install-schemas:
        GCONF_CONFIG_SOURCE=$(INSTALL_GCONF_CONFIG_SOURCE) $(top_builddir)/gconf/gconftool-$(MAJOR_VERSION) --makefile-install-rule $(srcdir)/$(schema_DATA)

Note that right now --makefile-install-rule will spawn an oafd and
annoy RPM packagers; next release of GConf will fix this (I have it
fixed on local disk).

Let me know if you have any problems.

Looking at the above configure/makefile stuff, I think it's a bit
broken - there's no point caring about DESTDIR because the config
source files should not be in an RPM file list. Instead we should be
installing the schema in %post. So you can probably simplify things
and avoid the INSTALL_GCONF_CONFIG_SOURCE variable.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]