homebrew-cask/Casks/wireshark.rb

77 lines
2.9 KiB
Ruby

cask "wireshark" do
url_arch = Hardware::CPU.intel? ? "Intel" : "Arm"
livecheck_arch = Hardware::CPU.intel? ? "x86-" : "arm"
version "3.6.1"
url "https://2.na.dl.wireshark.org/osx/Wireshark%20#{version}%20#{url_arch}%2064.dmg"
if Hardware::CPU.intel?
sha256 "f348d9fc1f67f4bf75aef3c45aca864dfc9b43cac488b86af8a7b85c671eb46e"
else
sha256 "878bd09f9bfb6e058e37020902eea92d3111480b4db3114357219042ff126fde"
end
name "Wireshark"
desc "Network protocol analyzer"
homepage "https://www.wireshark.org/"
livecheck do
url "https://www.wireshark.org/update/0/Wireshark/0.0.0/macOS/#{livecheck_arch}64/en-US/stable.xml"
strategy :sparkle
end
auto_updates true
conflicts_with cask: "wireshark-chmodbpf",
formula: "wireshark"
depends_on macos: ">= :sierra"
app "Wireshark.app"
pkg "Add Wireshark to the system path.pkg"
pkg "Install ChmodBPF.pkg"
binary "#{appdir}/Wireshark.app/Contents/MacOS/capinfos"
binary "#{appdir}/Wireshark.app/Contents/MacOS/captype"
binary "#{appdir}/Wireshark.app/Contents/MacOS/dftest"
binary "#{appdir}/Wireshark.app/Contents/MacOS/dumpcap"
binary "#{appdir}/Wireshark.app/Contents/MacOS/editcap"
binary "#{appdir}/Wireshark.app/Contents/MacOS/extcap/androiddump"
binary "#{appdir}/Wireshark.app/Contents/MacOS/extcap/ciscodump"
binary "#{appdir}/Wireshark.app/Contents/MacOS/extcap/randpktdump"
binary "#{appdir}/Wireshark.app/Contents/MacOS/extcap/sshdump"
binary "#{appdir}/Wireshark.app/Contents/MacOS/extcap/udpdump"
binary "#{appdir}/Wireshark.app/Contents/MacOS/idl2wrs"
binary "#{appdir}/Wireshark.app/Contents/MacOS/mergecap"
binary "#{appdir}/Wireshark.app/Contents/MacOS/mmdbresolve"
binary "#{appdir}/Wireshark.app/Contents/MacOS/randpkt"
binary "#{appdir}/Wireshark.app/Contents/MacOS/rawshark"
binary "#{appdir}/Wireshark.app/Contents/MacOS/reordercap"
binary "#{appdir}/Wireshark.app/Contents/MacOS/sharkd"
binary "#{appdir}/Wireshark.app/Contents/MacOS/text2pcap"
binary "#{appdir}/Wireshark.app/Contents/MacOS/tshark"
uninstall_preflight do
system_command "/usr/sbin/installer",
args: [
"-pkg", "#{staged_path}/Uninstall ChmodBPF.pkg",
"-target", "/"
],
sudo: true
system_command "/usr/sbin/installer",
args: [
"-pkg", "#{staged_path}/Remove Wireshark from the system path.pkg",
"-target", "/"
],
sudo: true
end
uninstall pkgutil: "org.wireshark.*"
zap trash: [
"~/.config/wireshark",
"~/Library/Caches/org.wireshark.Wireshark",
"~/Library/Cookies/org.wireshark.Wireshark.binarycookies",
"~/Library/HTTPStorages/org.wireshark.Wireshark.binarycookies",
"~/Library/Preferences/org.wireshark.Wireshark.plist",
"~/Library/Saved Application State/org.wireshark.Wireshark.savedState",
]
end