class LaunchSocketServer < Formula desc "Bind to privileged ports without running a server as root" homepage "https://github.com/mistydemeo/launch_socket_server" url "https://github.com/mistydemeo/launch_socket_server/archive/v2.0.0.tar.gz" sha256 "507184544d170dab63e6112198212033aaa84edf0e092c1dfe641087f092f365" head "https://github.com/mistydemeo/launch_socket_server.git" bottle do cellar :any_skip_relocation sha256 "ff86499103ad1d9d33cdc039e24f065aa08405bda980c9e242c46ed157bc33ff" => :catalina sha256 "823d84eddeb72fdabeccdc189bc19269485bfeb23d0a57824cdbf95c92a6ccb8" => :mojave sha256 "ef58f2afc33d6454282d1e1b92e4d16269885464707ae58079c29514f4cadc60" => :high_sierra end depends_on "go" => :build def install system "make", "install", "PREFIX=#{prefix}" end plist_options :startup => true def plist <<~EOS Label #{plist_name} RunAtLoad KeepAlive ProgramArguments #{opt_sbin}/launch_socket_server - Sockets Socket SockNodeName 0.0.0.0 SockServiceName 80 EnvironmentVariables LAUNCH_PROGRAM_TCP_ADDRESS 127.0.0.1:8080 StandardErrorPath #{var}/log/launch_socket_server.log StandardOutPath #{var}/log/launch_socket_server.log EOS end test do assert_includes shell_output("#{opt_sbin}/launch_socket_server 2>&1; true"), "usage: #{opt_sbin}/launch_socket_server" end end