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 "c67d91fb1c454af07cf7097484f673e91125aa89ff7e6de6eca8cde508cbe00b" => :sierra sha256 "effe7e754cefe38fa11a50409c7c3fc0ce9c84551de03dfd64302a382622378a" => :el_capitan sha256 "bada46216bdbb6e1e3f6c6506a1e9c8578a077ef8e1fdbcef40c4ef513c84d38" => :yosemite end devel do url "https://downloads.sourceforge.net/project/burp/burp-2.1.0/burp-2.1.0.tar.bz2" sha256 "12ffdc2513c1614b97f84c7d0ea597069e590f33a7acbec4a90e9e491c7946a7" resource "uthash" do url "https://github.com/troydhanson/uthash.git", :revision => "98fea52720444f7e2eb4eda2451f625618e4dc8b" 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.undent 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.undent 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