post_install() {
  set -e
  cd /usr/share/dradis-ce
  bundle config --local build.nokogiri --use-system-libraries
  # bundle config --local build.sqlite3 --enable-system-libraries
  bundle config --local path vendor/bundle
  bundle config set --local without development test
  ruby bin/setup
  systemd-sysusers dradis-ce.conf
  post_group "$@"
  post_common "$@"
}

post_upgrade() {
  set -e
  cd /usr/share/dradis-ce
  ruby bin/update
  post_group "$@"
  post_common "$@"
}

post_remove() {
  rm -r /usr/share/dradis-ce
}

post_group() {
  chown -R :dradis-ce /usr/share/dradis-ce
  chmod -R g+w /usr/share/dradis-ce
}

post_common() {
  echo ">>"
  echo ">>    To run dradis you need to be a member of the dradis-ce group"
}

