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.7.tar.gz" sha256 "e5ba978039de457f35f2923d0e97b163e412c55104d275c2ba211ce99d05e633" head "https://github.com/syncthing/syncthing-inotify.git" bottle do sha256 "442dd6b530e40bd18668f482f2071afa64fcf333892ae3b8a47f435d74396baa" => :sierra sha256 "651c2857b6b05a2122123e520153db5605f5b89b255b6fd99e785e9465e64691" => :el_capitan sha256 "da3e6893fd0d8b2a17f6bb486c1e9d23d3066a36faac1e845d8d373e2a5b32b5" => :yosemite end depends_on "go" => :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 "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