aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/arping.rb
blob: 5fef5a9f1cd88b1522280bff3165ea420bc64f04 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'formula'

class Arping < Formula
  url 'https://github.com/ThomasHabets/arping/tarball/arping-2.09'
  version '2.09'
  homepage 'https://github.com/ThomasHabets/arping'
  md5 '8a10b23655ffbe93667691fb881afbf4'

  depends_on 'libnet'

  def patches
    # Patch removes header conflict with libpcap; arping 2.x uses libnet
    DATA
  end

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"

    # See patches comment
    inreplace 'Makefile' do |s|
      s.change_make_var! "LIBS", " -lnet"
    end

    system "make"
    system "make install"
  end
end

__END__
diff --git a/src/arping.c b/src/arping.c
index 7b5e43e..b80e4d8 100644
--- a/src/arping.c
+++ b/src/arping.c
@@ -78,12 +78,14 @@
 #if HAVE_WIN32_LIBNET_H
 #include <win32/libnet.h>
 #endif
-#include <pcap.h>
 
 #if HAVE_NET_BPF_H
 #include <net/bpf.h>
 #endif
 
+#define PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap.h>
+
 #ifndef ETH_ALEN
 #define ETH_ALEN 6
 #endif