Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Documentation: https://docs.brew.sh/Formula-Cookbook
- # https://rubydoc.brew.sh/Formula
- # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
- class Go2rtc < Formula
- # name "go2rtc"
- desc "Ultimate camera streaming application with support RTSP, WebRTC, HomeKit, FFmpeg, RTMP, etc."
- homepage "https://github.com/AlexxIT/go2rtc"
- url "https://github.com/skrashevich/go2rtc/releases/download/v1.0.1-svk1/go2rtc_mac_universal.zip"
- sha256 "f35c7e37f80c1f3254ea7f61c00f081c9a55b6d071ea594fff60962d2443224a"
- license "MIT License"
- version "1.0.1-svk1"
- def install
- bin.install "go2rtc"
- end
- plist_name = "com.alexxit.go2rtc"
- plist_path = "#{HOMEBREW_PREFIX}/var/LaunchDaemons/#{plist_name}.plist"
- def plist; <<~EOS
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- <plist version="1.0">
- <dict>
- <key>Label</key>
- <string>#{plist_name}</string>
- <key>ProgramArguments</key>
- <array>
- <string>#{bin}/go2rtc</string>
- </array>
- <key>RunAtLoad</key>
- <true/>
- </dict>
- </plist>
- EOS
- end
- test do
- system "#{bin}/go2rtc", "version"
- end
- def post_install
- plist_path.write(plist)
- plist_path.chmod 0644
- end
- def post_uninstall
- plist_path.unlink
- end
- end
Add Comment
Please, Sign In to add comment