aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinaldo Junior2014-04-03 17:10:44 -0300
committerAdam Vandenberg2014-04-11 07:46:17 -0700
commit501d4e88717cda3612b45fdb6ff0d2d221e20944 (patch)
tree188eee8c5f0b9866ec72f2c1b57312cc6afdf4de
parente656ebda220b05ee1b8a09a4cc3a8c8427b1cf1a (diff)
downloadhomebrew-501d4e88717cda3612b45fdb6ff0d2d221e20944.tar.bz2
sysdig 0.1.73 (new formula)
Closes #28164. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Formula/sysdig.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/Library/Formula/sysdig.rb b/Library/Formula/sysdig.rb
new file mode 100644
index 000000000..757504466
--- /dev/null
+++ b/Library/Formula/sysdig.rb
@@ -0,0 +1,41 @@
+require "formula"
+
+class Sysdig < Formula
+ homepage "http://www.sysdig.org/"
+ url "https://github.com/draios/sysdig/archive/0.1.73.tar.gz"
+ sha1 "2f1133da0256c21c2642dbda57e047a3ae69765f"
+
+ head "https://github.com/draios/sysdig.git", :branch => "master"
+
+ 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
+ system "cmake", "..", *std_cmake_args
+ 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