Mailinglist Archive: opensuse-packaging (138 mails)

< Previous Next >
[opensuse-packaging] GConf scritplets for dummies
  • From: Stanislav Brabec <sbrabec@xxxxxxx>
  • Date: Thu, 22 Mar 2007 14:24:25 +0100
  • Message-id: <1174569865.17781.62.camel@xxxxxxxxxxxxxx>

Because many people asks, I am trying to explain problems with gconf
scriptlets in detail. After installation of any package with gconf
schemas, one needs to update gconf database.

It's easy to do it. Much more complicated situation occurs, when you
want to upgrade any application - you need to remove obsolete keys, but
not remove the new ones.

With older versions of RPM, it was not possible at all, so we installed
schemas and kept them forever. Now it is possible, so I created a new

It is be available in openSUSE 10.3 and in GNOME:UNSTABLE.

As a bonus, macros also create schemas part of file list for you - it
could not happen, that you forget to install any schemas file (which can
cause an application crash).

Here is a simple howto. It also contains some common tricks you will
need in packages:

Preamble (i. e. initial set of lines; put it as last command, automatic
spec formatters used by SuSE are not able to read lines after it):

%def_gconf_schemas subpackage1
%add_gconf_schemas schemas_name1
%add_gconf_schemas schemas_name2
%def_gconf_schemas subpackage2
%add_gconf_schemas schemas_name3
%add_gconf_schemas schemas_name4
schemas names are without path and suffix

%pre -f %{name}.schemas_pre

%preun -f %{name}.schemas_preun

%posttrans -f %{name}.schemas_posttrans

%files -f %{name}.schemas_list
%files -f subpackage.schemas_list

You don't have to list schemas files in the file list, it is done
automatically for you.

In case of more -f needed for one %files:

%find_lang %{name}
cat %{name}.schemas_list %{name}.lang >%{name}.lst

%files -f %{name}.lst

Best Regards / S pozdravem,

Stanislav Brabec
software developer
SUSE LINUX, s. r. o. e-mail: sbrabec@xxxxxxx
Lihovarsk√° 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic

To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups