Archive:Gtkmodules packaging guideline (draft)

From FedoraProject

Jump to: navigation, search

GTK+ modules

The GTK+ toolkit (in the gtk3 package) can be extended by loadable modules which can provide theme engines, input methods, print backends or other functionality. These modules have to be installed in subdirectories of %{_libdir}/gtk-3.0 or %{_libdir}/gtk-3.0/3.0.0. For the input methods, GTK+ maintains a cache in the text file %{_libdir}/gtk-3.0/3.0.0/immodules.cache. This cache file needs to be updated when the set of installed input methods changes, by calling the gtk-query-immodules-3.0 binary. Multilib considerations force us to install the binary in -32 and -64 variants.

The proposed scriptlets to maintain the cache file are:

%postun
gtk-query-immodules-3.0-%{__isa_bits} --update-cache || :

%posttrans
gio-query-immodules-3.0-%{__isa_bits} --update-cache || :

The 3.0 in the binary name is there because gtk2 has its own utility for the same purpose, called gtk-query-immodules-2.0. Note the use of %{__isa_bits}, which is an rpm macro that expands to either 32 or 64, depending on the architecture of the package.

In order to ensure that gtk-query-immodules-3.0 is available when the scriptlets are run, add Requires as necessary:

Requires(postun): gtk3
Requires(posttrans): gtk3