excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / a / autofirma.rb
blob1c72212035c55b4128b848adec8edfeb7ae17911
1 cask "autofirma" do
2   arch arm: "M1", intel: "x64"
3   pkg_arch = on_arch_conditional arm: "aarch64", intel: "x64"
5   version "1.8.4"
6   sha256 arm:   "2ffbf235fe0ff77c72707c674a67d4ffb924c05eca5910c7478dc96069c900a9",
7          intel: "a14b6203d597cd113a2f53d587d657320632011b29cea1fbeadfd663140bcbed"
9   url "https://estaticos.redsara.es/comunes/autofirma/#{version.major}/#{version.minor}/#{version.patch}/AutoFirma_Mac_#{arch}.zip",
10       verified: "estaticos.redsara.es/comunes/autofirma/"
11   name "AutoFirma"
12   desc "Digital signature editor and validator"
13   homepage "https://firmaelectronica.gob.es/Home/Descargas.htm"
15   livecheck do
16     url :homepage
17     regex(%r{autofirma/(\d+)/(\d+)/(\d+)/AutoFirma[._-]Mac[._-]#{arch}\.zip}i)
18     strategy :page_match do |page, regex|
19       page.scan(regex).map { |match| "#{match[0]}.#{match[1]}.#{match[2]}" }
20     end
21   end
23   pkg "AutoFirma_#{version.dots_to_underscores}_#{pkg_arch}.pkg"
25   # remove 'Autofirma ROOT' and '127.0.0.1' certificates from keychain (these were installed by pkg)
26   uninstall_postflight do
27     system_command "/usr/bin/security",
28                    args: [
29                      "delete-certificate",
30                      "-c", "AutoFirma ROOT"
31                    ],
32                    sudo: true
34     system_command "/usr/bin/security",
35                    args: [
36                      "delete-certificate",
37                      "-c", "127.0.0.1"
38                    ],
39                    sudo: true
40   end
42   uninstall quit:    "es.gob.afirma",
43             pkgutil: "es.gob.afirma",
44             delete:  "/Applications/AutoFirma.app"
46   zap trash: [
47     "~/.afirma",
48     "~/Library/Application Support/AutoFirma",
49     "~/Library/Preferences/es.gob.afirma.plist",
50   ]
51 end