forked from codedreality/homebrew-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscapy.rb
30 lines (26 loc) · 1.12 KB
/
scapy.rb
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
class Scapy < Formula
desc "Powerful interactive packet manipulation program"
homepage "http://www.secdev.org/projects/scapy/"
url "https://bitbucket.org/secdev/scapy/downloads/scapy-2.3.1.zip"
sha256 "8972c02e39a826a10c02c2bdd5025f7251dce9589c57befd9bb55c65f02e4934"
head "https://bitbucket.org/secdev/scapy", :using => :hg
depends_on :python
depends_on "libdnet"
resource "pylibpcap" do
url "https://downloads.sourceforge.net/project/pylibpcap/pylibpcap/0.6.4/pylibpcap-0.6.4.tar.gz"
sha256 "cfc365f2707a7986496acacf71789fef932a5ddbeaa36274cc8f9834831ca3b1"
end
def install
vendor_path = libexec/"vendor/lib/python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", vendor_path
resource("pylibpcap").stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
(lib/"python2.7/site-packages/homebrew-scapy-pylibpcap.pth").write "#{vendor_path}\n"
system "python", *Language::Python.setup_install_args(prefix)
end
test do
command = "rdpcap('#{test_fixtures("test.pcap")}')"
assert_match "TCP", pipe_output(bin/"scapy", command)
end
end