Navigation Menu

Skip to content

Commit

Permalink
ngrep 1.47
Browse files Browse the repository at this point in the history
project moved to GitHub
add a test

Closes #22398.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
  • Loading branch information
ilovezfs committed Jan 3, 2018
1 parent 08d3f73 commit a68bb27
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Formula/ngrep.rb
@@ -1,9 +1,8 @@
class Ngrep < Formula
desc "Network grep"
homepage "https://ngrep.sourceforge.io/"
url "https://downloads.sourceforge.net/project/ngrep/ngrep/1.45/ngrep-1.45.tar.bz2"
sha256 "aea6dd337da8781847c75b3b5b876e4de9c58520e0d77310679a979fc6402fa7"
revision 1
homepage "https://github.com/jpr5/ngrep"
url "https://github.com/jpr5/ngrep/archive/V1_47.tar.gz"
sha256 "dc4dbe20991cc36bac5e97e99475e2a1522fd88c59ee2e08f813432c04c5fff3"

bottle do
cellar :any_skip_relocation
Expand All @@ -15,23 +14,20 @@ class Ngrep < Formula
sha256 "a86b9021fa54635f144c7de70ea7dba6bd35a872f19cae877c341a00730c9d17" => :mavericks
end

# https://sourceforge.net/p/ngrep/bugs/27/
patch do
url "https://launchpadlibrarian.net/44952147/ngrep-fix-ipv6-support.patch"
sha256 "f1bcc0a344e5f454207254746cab5b1d216d3de3efaf08f59732f2182d42bbb1"
end

def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--enable-ipv6",
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path
system "./configure", "--enable-ipv6",
"--prefix=#{prefix}",
# this line required to make configure succeed
"--with-pcap-includes=#{MacOS.sdk_path}/usr/include/pcap",
"--with-pcap-includes=#{sdk}/usr/include/pcap",
# this line required to avoid segfaults
# see https://github.com/jpr5/ngrep/commit/e29fc29
# https://github.com/Homebrew/homebrew/issues/27171
"--disable-pcap-restart"
system "make", "install"
end

test do
assert_match version.to_s, shell_output("#{bin}/ngrep -V")
end
end

0 comments on commit a68bb27

Please sign in to comment.