post_install() {
    getent group nslcd >> /dev/null  || groupadd --gid 146 nslcd
    getent passwd nslcd >> /dev/null || useradd --gid 146 -M -d /var/run/nslcd -s /bin/false nslcd
}

post_upgrade() {
    post_install

    local ver
    local old_ver="$2"
    local upgrades=(0.9.5-3)

    for ver in "${upgrades[@]}"; do
        if [[ $(vercmp "$ver" "$old_ver") -eq 1 ]]; then
            "_${ver//-/_}_changes"
        fi
    done
}

_0.9.5_3_changes() {
    printf '%s\n' ':: nss-pam-ldapd will from 0.9.5-4 and on use the statically allocated UID/GID 146.'
    printf '%s\n' '   Please switch to the new UID and GID at your convenience.'
}
