skrashevich

My New Paste

Feb 4th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # Documentation: https://docs.brew.sh/Formula-Cookbook
  2. # https://rubydoc.brew.sh/Formula
  3. # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
  4. class Go2rtc < Formula
  5. # name "go2rtc"
  6. desc "Ultimate camera streaming application with support RTSP, WebRTC, HomeKit, FFmpeg, RTMP, etc."
  7. homepage "https://github.com/AlexxIT/go2rtc"
  8. url "https://github.com/skrashevich/go2rtc/releases/download/v1.0.1-svk1/go2rtc_mac_universal.zip"
  9. sha256 "f35c7e37f80c1f3254ea7f61c00f081c9a55b6d071ea594fff60962d2443224a"
  10. license "MIT License"
  11. version "1.0.1-svk1"
  12.  
  13. def install
  14. bin.install "go2rtc"
  15. end
  16.  
  17. plist_name = "com.alexxit.go2rtc"
  18. plist_path = "#{HOMEBREW_PREFIX}/var/LaunchDaemons/#{plist_name}.plist"
  19.  
  20. def plist; <<~EOS
  21. <?xml version="1.0" encoding="UTF-8"?>
  22. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  23. <plist version="1.0">
  24. <dict>
  25. <key>Label</key>
  26. <string>#{plist_name}</string>
  27. <key>ProgramArguments</key>
  28. <array>
  29. <string>#{bin}/go2rtc</string>
  30. </array>
  31. <key>RunAtLoad</key>
  32. <true/>
  33. </dict>
  34. </plist>
  35. EOS
  36. end
  37.  
  38. test do
  39. system "#{bin}/go2rtc", "version"
  40. end
  41.  
  42. def post_install
  43. plist_path.write(plist)
  44. plist_path.chmod 0644
  45. end
  46.  
  47. def post_uninstall
  48. plist_path.unlink
  49. end
  50. end
  51.  
Add Comment
Please, Sign In to add comment