cask "geekbench" do
  if MacOS.version <= :sierra
    version "4.4.2"
    sha256 "3c46e630a28a0752afd702fc1cd379edd2420001be22302c932e61751284c0cc"
  else
    version "5.3.1,503690"
    sha256 "54deea9d5a1bb12f73488c747e4272fef4e932e2febfa18f9a5a2002141687c0"
  end

  url "https://cdn.geekbench.com/Geekbench-#{version.before_comma}-Mac.zip"
  name "Geekbench"
  desc "Tool to measure the computer system's performance"
  homepage "https://www.geekbench.com/"

  livecheck do
    url "https://www.primatelabs.com/appcast/geekbench#{version.major}.xml"
    strategy :sparkle
  end

  auto_updates true

  app "Geekbench #{version.major}.app"

  zap trash: [
    "~/Library/Caches/com.primatelabs.Geekbench#{version.major}",
    "~/Library/Preferences/com.primatelabs.Geekbench#{version.major}.plist",
  ]
end
