class Ser2net < Formula desc "Allow network connections to serial ports" homepage "https://ser2net.sourceforge.io" url "https://downloads.sourceforge.net/project/ser2net/ser2net/ser2net-2.10.1.tar.gz" sha256 "cee4ad8fb3531281e8761751694dfab39d681022b2363b1edeba764d397c3c99" bottle do rebuild 1 sha256 "6cfa743d0e2090bed8f8c2e0495a840dfe77b1f3544582f60a0483315dcfe5ba" => :high_sierra sha256 "63b36a1ef39e534d2a8ae91caede4abea2dcfc4ed9ba1ef69f2da6a30baf7b31" => :sierra sha256 "5b94f195c765af83306e29f0d8e2556751cbdad1669866761faaeaf199023805" => :el_capitan end def install # Fix etc location inreplace ["ser2net.c", "ser2net.8"], "/etc/ser2net.conf", "#{etc}/ser2net.conf" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}" system "make", "install" etc.install "ser2net.conf" end def caveats; <<~EOS To configure ser2net, edit the example configuration in #{etc}/ser2net.conf EOS end plist_options :manual => "ser2net -p 12345" def plist; <<~EOS Label #{plist_name} RunAtLoad KeepAlive ProgramArguments #{opt_sbin}/ser2net -p 12345 WorkingDirectory #{HOMEBREW_PREFIX} EOS end test do assert_match version.to_s, shell_output("#{sbin}/ser2net -v") end end