excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / a / appgate-sdp-client.rb
blob5589790aa866bc9611daa615f5841a26d946de36
1 cask "appgate-sdp-client" do
2   on_mojave :or_older do
3     version "5.4.4"
4     sha256 "d9d0ffbaf628ee0b8e2d3457dc7b82d1a65ce34952d1f5edc4c4bf407a3d0f1b"
6     livecheck do
7       skip "Legacy version"
8     end
9   end
10   on_catalina do
11     version "6.0.4"
12     sha256 "bceed509db9fd8dab10f31686264ff7f073048d78470f85f06bbd6233eb9b111"
14     livecheck do
15       skip "Legacy version"
16     end
17   end
18   on_big_sur :or_newer do
19     version "6.4.1"
20     sha256 "37f0c48e42dcb04b569d80be3f1266aeba5e0c4b07ef6f48fa5e927c0afbfb3f"
22     livecheck do
23       url :homepage
24       regex(%r{href=.*?/Appgate[._-]SDP[._-]v?(\d+(?:\.\d+)+)[._-]Installer\.dmg}i)
25       strategy :page_match do |page, regex|
26         support_versions =
27           page.scan(%r{href=["']?([^"' >]*?/software-defined-perimeter-support/sdp[._-]v?(\d+(?:[.-]\d+)+))["' >]}i)
28               .sort_by { |match| Version.new(match[1]) }
29         next if support_versions.blank?
31         # Assume the last-sorted version is newest
32         version_page_path, = support_versions.last
34         # Check the page for the newest major/minor version, which links to the
35         # latest disk image file (containing the full version in the file name)
36         version_page = Homebrew::Livecheck::Strategy.page_content(
37           URI.join("https://www.appgate.com/", version_page_path).to_s,
38         )
39         next if version_page[:content].blank?
41         version_page[:content].scan(regex).map(&:first)
42       end
43     end
44   end
46   url "https://bin.appgate-sdp.com/#{version.major_minor}/client/Appgate-SDP-#{version}-Installer.dmg",
47       verified: "bin.appgate-sdp.com/"
48   name "AppGate SDP Client for macOS"
49   desc "Software-defined perimeter for secure network access"
50   homepage "https://www.appgate.com/support/software-defined-perimeter-support"
52   depends_on macos: ">= :mojave"
54   pkg "AppGate SDP Installer.pkg"
56   uninstall launchctl: [
57               "com.appgate.sdp.client.agent",
58               "com.appgate.sdp.tun",
59               "com.appgate.sdp.updater",
60               "com.cyxtera.appgate.sdp.client.agent",
61               "com.cyxtera.appgate.sdp.helper",
62               "com.cyxtera.appgate.sdp.tun",
63               "com.cyxtera.appgate.sdp.updater",
64             ],
65             quit:      [
66               "com.appgate.sdp",
67               "com.cyxtera.appgate.helper",
68               "com.cyxtera.appgate.sdp",
69             ],
70             signal:    ["QUIT", "com.cyxtera.appgate"],
71             pkgutil:   "com.appgate.pkg.appgatetun.component"
73   zap trash: [
74     "~/Library/Application Support/appgate-ui",
75     "~/Library/Caches/com.cyxtera.appgate.sdp.uninstall",
76     "~/Library/Preferences/com.cyxtera.appgate.sdp*",
77     "~/Library/Saved Application State/com.cyxtera.appgate.sdp.savedState",
78   ]
79 end