post_install() {
    calibre-alternatives set
}

post_upgrade() {
    calibre-alternatives set
}

post_remove() {
    if [ ! -e /usr/lib/calibre/bin ]; then
        rm -f /usr/lib/calibre/bin
        calibre-alternatives set 2>/dev/null || true
    fi
}
