class SyncthingInotify < Formula desc "File watcher intended for use with Syncthing" homepage "https://github.com/syncthing/syncthing-inotify" url "https://github.com/syncthing/syncthing-inotify/archive/v0.8.5.tar.gz" sha256 "552db71ddd086ffd21390e3bca4ceb2de53e0d4383a9321b8be17611ddb92aa4" head "https://github.com/syncthing/syncthing-inotify.git" bottle do sha256 "dec93b9b38dbb1eb1ac03ee0ba536f48b1cf87f224fd193ffe64f4f824de4646" => :sierra sha256 "f9fee9216c207e1c2ba0b004d4a5dc83a204a5845c7a6445999ba4baebb0d8bb" => :el_capitan sha256 "c6ad5afd61f7c91fb4ed60c6bfccee2a1d9ae532509a7edd2ae24bbaa74dbd4d" => :yosemite end depends_on "go" => :build depends_on "godep" => :build def install ENV["GOPATH"] = buildpath ENV["GOROOT"] = Formula["go"].opt_libexec dir = buildpath/"src/github.com/syncthing/syncthing-inotify" dir.install buildpath.children cd dir do system "godep", "restore" system "go", "build", "-ldflags", "-w -X main.Version=#{version}" bin.install name end end plist_options :manual => "syncthing-inotify" def plist; <<-EOS.undent KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/syncthing-inotify RunAtLoad ProcessType Background StandardErrorPath #{var}/log/syncthing-inotify.log StandardOutPath #{var}/log/syncthing-inotify.log EOS end test do system bin/"syncthing-inotify", "-version" end end