aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/zmap.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/Library/Formula/zmap.rb b/Library/Formula/zmap.rb
new file mode 100644
index 000000000..d37661534
--- /dev/null
+++ b/Library/Formula/zmap.rb
@@ -0,0 +1,35 @@
+require 'formula'
+
+class Zmap < Formula
+ homepage 'https://zmap.io'
+ url 'https://github.com/zmap/zmap/archive/v1.2.0.tar.gz'
+ sha1 'c3efb59c6433c790570aca5964f5d98f3464d330'
+
+ head 'https://github.com/zmap/zmap.git'
+
+ depends_on 'cmake' => :build
+ depends_on 'gengetopt' => :build
+ depends_on 'byacc' => :build
+ depends_on 'gmp'
+ depends_on 'libdnet'
+ depends_on 'json-c' => :optional
+ depends_on 'hiredis' => :optional
+
+ def install
+ inreplace ['conf/zmap.conf','src/zmap.c','src/zopt.ggo'], '/etc', etc
+
+ args = std_cmake_args
+ args << '-DRESPECT_INSTALL_PREFIX_CONFIG=ON'
+ args << '-DWITH_JSON=ON' if build.with? 'json-c'
+ args << '-DWITH_REDIS=ON' if build.with? 'hiredis'
+
+ system "cmake", ".", *args
+ system "make", "install"
+ end
+
+ test do
+ system "#{sbin}/zmap", "--version"
+ assert_match /json/, `#{sbin}/zmap --list-output-modules` if build.with? 'json-c'
+ assert_match /redis/, `#{sbin}/zmap --list-output-modules` if build.with? 'hiredis'
+ end
+end