post_install() {
  [[ -d var/lib/tox-bootstrapd ]] || install -dm 750 -o 199 -g 199 var/lib/tox-bootstrapd
}

post_upgrade() {
  (( $(vercmp $2 '3523-3') < 0 )) && (
    [[ -d var/lib/tox-bootstrapd ]] || install -dm 750 -o 199 -g 199 var/lib/tox-bootstrapd
  ) || true
  (( $(vercmp $2 '1:0.1.4-2') < 0 )) && (
    # remove previously created tox-bootstrapd user
    userdel tox-bootstrapd || true
    # chown to new tox-bootstrapd that will be created by sysusers.d
    chown -R 199:199 var/lib/tox-bootstrapd
  ) || true
}
