summary refs log tree commit diff
path: root/pkgs/tools/networking/ngrep/default.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-01-04 12:45:06 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-01-04 18:34:53 +0100
commit9443129b08b37a6f4267d257cd8d42dd92a2539c (patch)
treeaec261361299cc2d85827dbcf5d03b594ae85e28 /pkgs/tools/networking/ngrep/default.nix
parentf78534ca0f8ec63d79370eb2367605579efba088 (diff)
parentf6d51f7717cffd8b220ce02498db8b8359b5964c (diff)
downloadnixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.gz
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.bz2
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.lz
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.xz
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.tar.zst
nixlib-9443129b08b37a6f4267d257cd8d42dd92a2539c.zip
Merge master into stdenv-updates
Conflicts:
	pkgs/development/libraries/glibc/2.18/common.nix (take stdenv-updates)
	pkgs/misc/emulators/zsnes/default.nix (more complex, build tested)
	pkgs/top-level/all-packages.nix (auto-solved)
Diffstat (limited to 'pkgs/tools/networking/ngrep/default.nix')
-rw-r--r--pkgs/tools/networking/ngrep/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ngrep/default.nix b/pkgs/tools/networking/ngrep/default.nix
new file mode 100644
index 000000000000..361d44eaca75
--- /dev/null
+++ b/pkgs/tools/networking/ngrep/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, libpcap }:
+
+stdenv.mkDerivation rec {
+  name = "ngrep-1.45";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ngrep/${name}.tar.bz2";
+    sha256 = "19rg8339z5wscw877mz0422wbsadds3mnfsvqx3ihy58glrxv9mf";
+  };
+
+  buildInputs = [ libpcap ];
+
+  preConfigure = ''
+    # Fix broken test for BPF header file
+    sed -i "s|BPF=.*|BPF=${libpcap}/include/pcap/bpf.h|" configure
+
+    configureFlags="$configureFlags --with-pcap-includes=${libpcap}/include"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Network packet analyzer";
+    longDescription = ''
+      ngrep strives to provide most of GNU grep's common features, applying
+      them to the network layer. ngrep is a pcap-aware tool that will allow you
+      to specify extended regular or hexadecimal expressions to match against
+      data payloads of packets. It currently recognizes IPv4/6, TCP, UDP,
+      ICMPv4/6, IGMP and Raw across Ethernet, PPP, SLIP, FDDI, Token Ring and
+      null interfaces, and understands BPF filter logic in the same fashion as
+      more common packet sniffing tools, such as tcpdump and snoop.
+    '';
+    homepage = http://ngrep.sourceforge.net/;
+    # <ngrep>/doc/README.txt says that ngrep itself is licensed under a
+    # 'BSD-like' license but that the 'regex' library (in the ngrep tarball) is
+    # GPLv2.
+    license = "BSD-like";
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}