2014-04-03 20:10:44 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Sysdig < Formula
|
|
|
|
homepage "http://www.sysdig.org/"
|
2014-08-10 19:35:37 +00:00
|
|
|
url "https://github.com/draios/sysdig/archive/0.1.87.tar.gz"
|
|
|
|
sha1 "d0b3fd919907da64a624029e5d444c6b8b584aaa"
|
2014-04-03 20:10:44 +00:00
|
|
|
|
|
|
|
head "https://github.com/draios/sysdig.git", :branch => "master"
|
|
|
|
|
2014-06-04 18:15:06 +00:00
|
|
|
bottle do
|
2014-08-10 19:45:20 +00:00
|
|
|
sha1 "0c06c1dd0c4e99b57e76e7dfb8f0948beac39d00" => :mavericks
|
|
|
|
sha1 "47189a77a225fb8dd7052432dc330b737fb7d55e" => :mountain_lion
|
|
|
|
sha1 "68abab7c2c5d631fda04798bf9c021fb13aba1b0" => :lion
|
2014-06-04 18:15:06 +00:00
|
|
|
end
|
|
|
|
|
2014-04-03 20:10:44 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
|
|
|
# More info on https://gist.github.com/juniorz/9986999
|
|
|
|
resource "sample_file" do
|
|
|
|
url "https://gist.githubusercontent.com/juniorz/9986999/raw/a3556d7e93fa890a157a33f4233efaf8f5e01a6f/sample.scap"
|
|
|
|
sha1 "0aa3c30b954f9fb0d7320d900d3a103ade6b1cec"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.libcxx if MacOS.version < :mavericks
|
|
|
|
|
|
|
|
mkdir "build" do
|
2014-06-05 03:44:55 +00:00
|
|
|
system "cmake", "..", "-DSYSDIG_VERSION=#{version}", *std_cmake_args
|
2014-04-03 20:10:44 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(share/"demos").install resource("sample_file").files("sample.scap")
|
|
|
|
|
|
|
|
# tests if it can load chisels
|
|
|
|
`#{bin}/sysdig -cl`
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
|
|
|
|
# tests if it can read a sample capture file
|
|
|
|
# uses a custom output format because evt.time (in default format) is not UTC
|
|
|
|
expected_output = "1 open fd=5(<f>/tmp/sysdig/sample.scap) name=sample.scap(/tmp/sysdig/sample.scap) flags=262(O_TRUNC|O_CREAT|O_WRONLY) mode=0"
|
|
|
|
|
|
|
|
assert_equal expected_output, `#{bin}/sysdig -r #{share}/demos/sample.scap -p "%evt.num %evt.type %evt.args" evt.type=open fd.name contains /tmp/sysdig/sample.scap`.strip
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
end
|
|
|
|
end
|