post_install() {
    echo -n "compiling 256 color terminfo..."
    tic /usr/share/screen/screen-256color.ti
    echo "done."
    echo ":: Set 'term screen-256color' or use 'term screen-256color-bce'"
    echo "   with 'defbce on' in ~/.screenrc to use 256 colors"

}

pre_upgrade() {
    pre_remove $*
}

post_upgrade() {
    post_install $*
}

pre_remove() {
    compiled="/usr/share/terminfo/s/screen-256color"
    if [ -e $compiled ]; then
        echo -n "removing compiled terminfo..."
        rm -f $compiled
        echo "done."
    fi
    compiled="/usr/share/terminfo/s/screen-256color-bce"
    if [ -e $compiled ]; then
        echo -n "removing compiled terminfo..."
        rm -f $compiled
        echo "done."
    fi
}

op=$1
shift
$op $*
