_chown() {
  chown -R perspectives:perspectives \
        /usr/share/webapps/perspectives-server \
        /etc/webapps/perspectives-server \
        /etc/conf.d/perspectives-server.conf
}

post_install() {
  groupadd --system perspectives

  useradd --system \
          --comment "Perspectives Notary Server" \
          --gid perspectives \
          --home /usr/share/webapps/perspectives-server -M \
          --shell /bin/false \
          perspectives &>/dev/null
  _chown
}

post_upgrade() {
  _chown
}

post_remove() {
  userdel perspectives
  groupdel perspectives
}
