43 lines
1.3 KiB
Ruby
43 lines
1.3 KiB
Ruby
cask "autofirma" do
|
|
version "1.7.1"
|
|
sha256 "83131c5809815742bf23406361b514f8c798d9f9dc344b7a42bc178886dbd0da"
|
|
|
|
url "https://estaticos.redsara.es/comunes/autofirma/#{version.major}/#{version.minor}/#{version.patch}/AutoFirma_Mac.zip",
|
|
verified: "estaticos.redsara.es/comunes/autofirma/"
|
|
name "AutoFirma"
|
|
desc "Digital signature editor and validator"
|
|
homepage "https://firmaelectronica.gob.es/Home/Descargas.htm"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
strategy :page_match do |page|
|
|
match = page.match(%r{href=.*?/(\d+)/(\d+)/(\d+)/AutoFirma_Mac.zip}i)
|
|
next if match.blank?
|
|
|
|
"#{match[1]}.#{match[2]}.#{match[3]}"
|
|
end
|
|
end
|
|
|
|
pkg "AutoFirma_#{version.dots_to_underscores}.pkg"
|
|
|
|
# remove 'Autofirma ROOT' and '127.0.0.1' certificates from keychain (these were installed by pkg)
|
|
uninstall_postflight do
|
|
system_command "/usr/bin/security",
|
|
args: [
|
|
"delete-certificate",
|
|
"-c", "AutoFirma ROOT"
|
|
],
|
|
sudo: true
|
|
|
|
system_command "/usr/bin/security",
|
|
args: [
|
|
"delete-certificate",
|
|
"-c", "127.0.0.1"
|
|
],
|
|
sudo: true
|
|
end
|
|
|
|
uninstall pkgutil: "es.gob.afirma",
|
|
delete: "/Applications/AutoFirma.app"
|
|
end
|