aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/hping.rb
blob: 341295f7658efd311a841ca3df3f54b06441fe05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'formula'

class Hping < Formula
  homepage 'http://www.hping.org/'
  url 'http://www.hping.org/hping3-20051105.tar.gz'
  md5 'ca4ea4e34bcc2162aedf25df8b2d1747'
  version '3.20051105'

  def patches
    {:p0 => [
      # MacPorts patches: http://trac.macports.org/browser/trunk/dports/net/hping3
      "https://trac.macports.org/export/70033/trunk/dports/net/hping3/files/patch-libpcap_stuff.c.diff",
      "https://trac.macports.org/export/70033/trunk/dports/net/hping3/files/patch-ars.c.diff",
      "https://trac.macports.org/export/70033/trunk/dports/net/hping3/files/patch-sendip.c.diff",
      "https://trac.macports.org/export/70033/trunk/dports/net/hping3/files/patch-Makefile.in.diff",
      "https://trac.macports.org/export/70033/trunk/dports/net/hping3/files/patch-bytesex.h.diff"
    ]}
  end

  def install
    # Compile fails with tcl support; TCL on OS X is 32-bit only
    system "./configure", "--no-tcl"

    # Target folders need to exist before installing
    sbin.mkpath
    man8.mkpath
    system "make", "CC=#{ENV.cc}",
                   "COMPILE_TIME=#{ENV.cflags}",
                   "INSTALL_PATH=#{prefix}",
                   "INSTALL_MANPATH=#{man}",
                   "install"
  end
end