Merge pull request #194004 from Homebrew/bump-binance-1.54.4
[Homebrew/homebrew-cask.git] / Casks / k / konica-minolta-bizhub-c750i-driver.rb
bloba302a75adc7ed9ed42e77df562de32f6e4c4b30d
1 cask "konica-minolta-bizhub-c750i-driver" do
2   on_catalina :or_older do
3     version "3.0.1,6454ed166639340e7f81bda0dcaeb554,129004"
4     sha256 "4aebd127a1ca363611e04ebb5666efdaf3de2dff1e933bb7ac82f832de878f94"
6     livecheck do
7       skip "Legacy version"
8     end
10     pkg "A4/C750i_C650i_C360i_C287i_C286i_C4050i_C4000i_C3320i.pkg"
11   end
12   on_big_sur :or_newer do
13     version "5.2.13A,f1fb1a90149884556bd74a91d4a1053e,143775"
14     sha256 "7fce1b8fba0dd65007f5a6e099d6db4b84aea56bbb71472c8eb5ac50b322a443"
16     livecheck do
17       url "https://dl.konicaminolta.eu/en?tx_kmdownloadcenter_dlajaxservice[action]=getDocuments&tx_kmdownloadcenter_dlajaxservice[controller]=AjaxService&tx_kmdownloadcenter_dlajaxservice[productId]=103745&tx_kmdownloadcenter_dlajaxservice[system]=KonicaMinolta&cHash=dd72618a38434b6cb3edfc20595d58c5&type=1527583889"
18       strategy :json do |json|
19         items = json.select do |i|
20           i["TypeOfApplicationName_textS"]&.match?(/driver/i) &&
21             i["OperatingSystemsNames_textM"]&.any? { |item| item =~ /macOS/i }
22         end
24         item = items.max_by { |i| i["ReleaseDate_textS"] }
25         files = item["DownloadFiles_textS"].split("\n").map { |file| file.split("|") }
26         dmg = files.find { |f| f.first.end_with?(".dmg") }
28         "#{item["Version_textS"]},#{Digest::MD5.hexdigest(dmg[2])},#{item["AnacondaId_textS"]}"
29       end
30     end
32     pkg "C750i_C287i_C4050i_C751i_C4051i_11.pkg"
33   end
35   url "https://dl.konicaminolta.eu/en?tx_kmdownloadcentersite_downloadproxy[fileId]=#{version.csv.second}&tx_kmdownloadcentersite_downloadproxy[documentId]=#{version.csv.third}&tx_kmdownloadcentersite_downloadproxy[system]=KonicaMinolta&tx_kmdownloadcentersite_downloadproxy[language]=EN&type=1558521685"
36   name "Konica Minolta Bizhub C750i/C650i/C360i/C287i/C286i/C4050i/C4000i/C3320i Printer Driver"
37   desc "PostScript printer driver"
38   homepage "https://www.konicaminolta.eu/eu-en/support/download-centre"
40   depends_on macos: ">= :sierra"
42   uninstall_preflight do
43     set_ownership "/Library/Printers/KONICAMINOLTA/Preferences"
44   end
46   uninstall pkgutil: "jp.konicaminolta.print.package.C751i"
48   zap trash: [
49         "/Library/Printers/KONICAMINOLTA/Preferences/jp.konicaminolta.printers.C751i",
50         "/Library/Printers/KONICAMINOLTA/Preferences/jp.konicaminolta.printers.C751i.plist",
51       ],
52       rmdir: "/Library/Printers/KONICAMINOLTA"
53 end