cask "opencpn" do version "5.14.2,-universal+18284.bd6986a08-14" sha256 "cf56e9c55c2d72cae5ae3013876139f61b7757edc9777a022bddedc11fc3922b" url "https://github.com/OpenCPN/OpenCPN/releases/download/Release_#{version.csv.first}/OpenCPN_#{version.csv.first}#{version.csv.second}.pkg" name "OpenCPN" desc "Full-featured and concise ChartPlotter/Navigator" homepage "https://www.opencpn.org/" livecheck do url "https://www.opencpn.org/OpenCPN/info/downloadopencpn.html" regex(/href=.*?OpenCPN[._-]?v?(\d+(?:\.+\d+)+)((?:-\d+)?(?:-universal)?\+\d+\.\h+(?:-\d+)?)?\.(?:dmg|pkg)/i) strategy :page_match do |page, regex| match = page.match(regex) next if match.blank? match[2].present? ? "#{match[1]},#{match[2]}" : match[1] end end depends_on :macos pkg "OpenCPN_#{version.csv.first}#{version.csv.second}.pkg" uninstall pkgutil: [ "org.opencpn", "org.opencpn.pkg.OpenCPN", ] zap trash: [ "~/Library/Logs/opencpn.log", "~/Library/Preferences/opencpn", "~/Library/Preferences/org.opencpn.plist", "~/Library/Saved Application State/org.opencpn.savedState", ] end