diff --git a/Mozilla/Firefox-Linux.installscript.recipe.yaml b/Mozilla/Firefox-Linux.installscript.recipe.yaml index 6ec6254..0a174b4 100644 --- a/Mozilla/Firefox-Linux.installscript.recipe.yaml +++ b/Mozilla/Firefox-Linux.installscript.recipe.yaml @@ -11,14 +11,6 @@ Input: MinimumVersion: "2.3" ParentRecipe: com.github.jgstew.download.Firefox-Linux Process: - - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary - - - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend - Arguments: - dictionary_name: template_dictionary - append_key: file_sha256 - append_value: "%filehasher_sha256%" - - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend Arguments: dictionary_name: template_dictionary diff --git a/Mozilla/Firefox-Mac.cask.rb b/Mozilla/Firefox-Mac.cask.rb new file mode 100644 index 0000000..7c58709 --- /dev/null +++ b/Mozilla/Firefox-Mac.cask.rb @@ -0,0 +1,64 @@ +# https://github.com/Homebrew/homebrew-cask/blob/master/Casks/f/firefox.rb +# brew install --cask --verbose ~/Library/AutoPkg/Cache/com.github.jgstew.cask.Firefox-Mac/firefox.rb +cask "firefox" do + version "{{version}}" + + language "en", default: true do + sha256 "{{file_sha256}}" + "en-US" + end + + url "https://download-installer.cdn.mozilla.net/pub/firefox/releases/#{version}/mac/#{language}/Firefox%20#{version}.dmg", + verified: "download-installer.cdn.mozilla.net/pub/firefox/releases/" + name "Mozilla Firefox" + desc "Web browser" + homepage "https://www.mozilla.org/firefox/" + + livecheck do + url "https://download.mozilla.org/?product=firefox-latest-ssl&os=osx" + strategy :header_match + end + + auto_updates true + conflicts_with cask: [ + "firefox@beta", + "firefox@cn", + "firefox@esr", + ] + depends_on macos: ">= :catalina" + + app "Firefox.app" + # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) + shimscript = "#{staged_path}/firefox.wrapper.sh" + binary shimscript, target: "firefox" + + preflight do + File.write shimscript, <<~EOS + #!/bin/bash + exec '#{appdir}/Firefox.app/Contents/MacOS/firefox' "$@" + EOS + end + + uninstall quit: "org.mozilla.firefox" + + zap trash: [ + "/Library/Logs/DiagnosticReports/firefox_*", + "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.mozilla.firefox.sfl*", + "~/Library/Application Support/CrashReporter/firefox_*", + "~/Library/Application Support/Firefox", + "~/Library/Caches/Firefox", + "~/Library/Caches/Mozilla/updates/Applications/Firefox", + "~/Library/Caches/org.mozilla.crashreporter", + "~/Library/Caches/org.mozilla.firefox", + "~/Library/Preferences/org.mozilla.crashreporter.plist", + "~/Library/Preferences/org.mozilla.firefox.plist", + "~/Library/Saved Application State/org.mozilla.firefox.savedState", + "~/Library/WebKit/org.mozilla.firefox", + ], + rmdir: [ + "~/Library/Application Support/Mozilla", # May also contain non-Firefox data + "~/Library/Caches/Mozilla", + "~/Library/Caches/Mozilla/updates", + "~/Library/Caches/Mozilla/updates/Applications", + ] + end diff --git a/Mozilla/Firefox-Mac.cask.recipe.yaml b/Mozilla/Firefox-Mac.cask.recipe.yaml new file mode 100644 index 0000000..b68e80d --- /dev/null +++ b/Mozilla/Firefox-Mac.cask.recipe.yaml @@ -0,0 +1,16 @@ +# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US +--- +Description: Creates an install script for the latest version of Firefox +Identifier: com.github.jgstew.cask.Firefox-Mac +Input: + NAME: "Firefox" + product: firefox-latest-ssl + OS: osx + filename: Firefox.dmg +MinimumVersion: "2.3" +ParentRecipe: com.github.jgstew.download.Firefox-Mac +Process: + - Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate + Arguments: + template_file_path: "./Mozilla/Firefox-Mac.cask.rb" + content_file_pathname: "%RECIPE_CACHE_DIR%/firefox.rb" diff --git a/Mozilla/Firefox-Mac.download.recipe.yaml b/Mozilla/Firefox-Mac.download.recipe.yaml index 2338636..23d28a2 100644 --- a/Mozilla/Firefox-Mac.download.recipe.yaml +++ b/Mozilla/Firefox-Mac.download.recipe.yaml @@ -34,3 +34,11 @@ Process: datetime_parsed_name: SourceReleaseDate - Processor: com.github.jgstew.SharedProcessors/FileHasher + + - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary + + - Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend + Arguments: + dictionary_name: template_dictionary + append_key: file_sha256 + append_value: "%filehasher_sha256%"