class Twoping < Formula desc "Ping utility to determine directional packet loss" homepage "http://www.finnie.org/software/2ping/" url "http://www.finnie.org/software/2ping/2ping-3.0.1.tar.gz" sha256 "d6997cd1680151e6f7d5e60137d45cd41bf385d26029878afdaaf5dc4f63dcc4" revision 1 bottle do cellar :any_skip_relocation sha256 "f63e7af668f34e6b293e5a554832a7432de14cbb71c15e0a225c6ea1ce3e3924" => :el_capitan sha256 "13794ca27a86eec6ede9a1f1cd3d01cda5f675db91c2e937471bf7d718c0fed4" => :yosemite sha256 "b2a81bf692ca4fc69367536e069634438dd2dce53a9f0f7e05b6749342a96db4" => :mavericks end def install ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" system "python", *Language::Python.setup_install_args(libexec) man1.install "doc/2ping.1" man1.install_symlink "2ping.1" => "2ping6.1" bin.install Dir["#{libexec}/bin/*"] bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end plist_options :manual => "2ping --listen", :startup => true def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_bin}/2ping --listen --quiet UserName nobody StandardErrorPath /dev/null StandardOutPath /dev/null RunAtLoad KeepAlive EOS end test do system bin/"2ping", "-c", "5", "test.2ping.net" end end