#! /bin/sh

case "$1" in
    configure)
        # alternativize the stock gzip (busybox)
        readlink /bin/gzip | grep -q busybox && \
        update-alternatives --install /bin/gzip gzip /bin/busybox 25 \
            --slave /bin/gunzip gunzip /bin/busybox \
            --slave /bin/zcat zcat /bin/busybox
        update-alternatives --install /bin/gzip gzip /bin/gzip.gzip 50 \
            --slave /bin/gunzip gunzip /bin/uncompress.gzip \
            --slave /bin/zcat zcat /bin/zcat.gzip
        update-alternatives --install /bin/uncompress uncompress /bin/uncompress.gzip 50

        # Update MIME database only if it's older than the packages dir
        test /usr/share/mime/mime.cache -ot /usr/share/mime/packages && \
            update-mime-database /usr/share/mime
        gtk-update-icon-cache -f /usr/share/icons/hicolor
        ;;
esac

#DEBHELPER#
