class Burp < Formula desc "Network backup and restore" homepage "http://burp.grke.org/" stable do url "https://downloads.sourceforge.net/project/burp/burp-2.0.54/burp-2.0.54.tar.bz2" sha256 "ae10470586f1fee4556eaae5b3c52b78cfc0eac4109f4b8253c549e7ff000d86" resource "uthash" do url "https://github.com/troydhanson/uthash/archive/v2.0.1.tar.gz" sha256 "613b95fcc368b7d015ad2d0802313277012f50c4ac290c3dfc142d42ebea3337" end end bottle do sha256 "9514e480afa08c9dfe14be59610beaf691a6bfe1e2d58327fe57278f822aeedc" => :high_sierra sha256 "c67d91fb1c454af07cf7097484f673e91125aa89ff7e6de6eca8cde508cbe00b" => :sierra sha256 "effe7e754cefe38fa11a50409c7c3fc0ce9c84551de03dfd64302a382622378a" => :el_capitan sha256 "bada46216bdbb6e1e3f6c6506a1e9c8578a077ef8e1fdbcef40c4ef513c84d38" => :yosemite end devel do url "https://downloads.sourceforge.net/project/burp/burp-2.1.24/burp-2.1.24.tar.bz2" sha256 "f37edad8144ac39346c83ecf0c08d477bbcdd6231be25bba798e92ee9ed0ed3d" resource "uthash" do url "https://github.com/troydhanson/uthash.git", :revision => "7f1b50be94ceffcc7acd7a7f3f0f8f9aae52cc2f" end end head do url "https://github.com/grke/burp.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build resource "uthash" do url "https://github.com/troydhanson/uthash.git" end end depends_on "librsync" depends_on "openssl" def install resource("uthash").stage do system "make", "-C", "libut" (buildpath/"uthash/lib").install "libut/libut.a" (buildpath/"uthash/include").install Dir["src/*"] end ENV.prepend "CPPFLAGS", "-I#{buildpath}/uthash/include" ENV.prepend "LDFLAGS", "-L#{buildpath}/uthash/lib" system "autoreconf", "-fiv" if build.head? system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}/burp", "--sbindir=#{bin}", "--localstatedir=#{var}" system "make", "install-all" end def post_install (var/"run").mkpath (var/"spool/burp").mkpath end def caveats; <<~EOS Before installing the launchd entry you should configure your burp client in #{etc}/burp/burp.conf EOS end plist_options :startup => true def plist; <<~EOS Label #{plist_name} UserName root KeepAlive ProgramArguments #{opt_bin}/burp -a t StartInterval 1200 WorkingDirectory #{HOMEBREW_PREFIX} EOS end test do system bin/"burp", "-v" end end