Skip to content

Commit

Permalink
working firefox linux and mac examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Jul 7, 2024
1 parent 481845b commit c42d434
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Mozilla/Firefox-Linux.installscript.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
64 changes: 64 additions & 0 deletions Mozilla/Firefox-Mac.cask.rb
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions Mozilla/Firefox-Mac.cask.recipe.yaml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 8 additions & 0 deletions Mozilla/Firefox-Mac.download.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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%"

0 comments on commit c42d434

Please sign in to comment.