#!/bin/sh
set -e
if [ "x$D" != "x" ]; then
    $INTERCEPT_DIR/postinst_intercept update_gtk_immodules_cache matchbox-keyboard-im \
            mlprefix= \
            binprefix= \
            libdir=/usr/lib \
            libexecdir=/usr/libexec \
            base_libdir=/usr/lib \
            bindir=/usr/bin
else
    if [ ! -z `which gtk-query-immodules-2.0` ]; then
        gtk-query-immodules-2.0 > /usr/lib/gtk-2.0/2.10.0/immodules.cache
    fi
    if [ ! -z `which gtk-query-immodules-3.0` ]; then
        mkdir -p /usr/lib/gtk-3.0/3.0.0
        gtk-query-immodules-3.0 > /usr/lib/gtk-3.0/3.0.0/immodules.cache
    fi
fi
