From eb98989cf0e8dc86445408bf07abb2dc7552344d Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Fri, 8 May 2015 13:19:31 +0200 Subject: [PATCH] Add libcrafter and tracebox --- .../libraries/libcrafter/default.nix | 26 ++++++++++++++++ pkgs/tools/networking/tracebox/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 3 files changed, 61 insertions(+) create mode 100644 pkgs/development/libraries/libcrafter/default.nix create mode 100644 pkgs/tools/networking/tracebox/default.nix diff --git a/pkgs/development/libraries/libcrafter/default.nix b/pkgs/development/libraries/libcrafter/default.nix new file mode 100644 index 000000000000..e775e9ef63f7 --- /dev/null +++ b/pkgs/development/libraries/libcrafter/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchzip, autoconf, automake, libtool, libpcap }: + +stdenv.mkDerivation rec { + name = "libcrafter-${version}"; + version = "0.3"; + + src = fetchzip { + url = "https://github.com/pellegre/libcrafter/archive/version-${version}.zip"; + sha256 = "04lpmshh4wb1dav03p6rnskpd1zmmvhv80xwn8v7l8faps5gvjp4"; + }; + + preConfigure = "cd libcrafter"; + + configureScript = "./autogen.sh"; + + configureFlags = [ "--with-libpcap=yes" ]; + + buildInputs = [ autoconf automake libtool ]; + + propagatedBuildInputs = [ libpcap ]; + + meta = { + homepage = https://github.com/pellegre/libcrafter; + description = "High level C++ network packet sniffing and crafting library"; + }; +} diff --git a/pkgs/tools/networking/tracebox/default.nix b/pkgs/tools/networking/tracebox/default.nix new file mode 100644 index 000000000000..8c443282e5cb --- /dev/null +++ b/pkgs/tools/networking/tracebox/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchzip, autoreconfHook, libcrafter, libpcap, lua }: + +stdenv.mkDerivation rec { + name = "tracebox-${version}"; + version = "0.2"; + + src = fetchzip { + url = "https://github.com/tracebox/tracebox/archive/v${version}.zip"; + sha256 = "0gxdapm6b5a41gymi1f0nr2kyz70vllnk10085yz3pq527gp9gns"; + }; + + buildInputs = [ autoreconfHook libcrafter lua ]; + + configureFlags = [ "--with-lua=yes" ]; + + NIX_LDFLAGS = [ "${libpcap}/lib/libpcap.so" "${libcrafter}/lib/libcrafter.so" ]; + + preAutoreconf = '' + substituteInPlace Makefile.am --replace "noinst" "" + sed '/noinst/d' -i configure.ac + sed '/libcrafter/d' -i src/tracebox/Makefile.am + ''; + + meta = with stdenv.lib; { + homepage = http://www.tracebox.org/; + description = "A middlebox detection tool"; + license = stdenv.lib.licenses.gpl2; + maintainers = [ maintainers.lethalman ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c38feccb5108..79b50719bf64 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2970,6 +2970,8 @@ let traceroute = callPackage ../tools/networking/traceroute { }; + tracebox = callPackage ../tools/networking/tracebox { }; + trash-cli = callPackage ../tools/misc/trash-cli { }; trickle = callPackage ../tools/networking/trickle {}; @@ -6376,6 +6378,8 @@ let libchardet = callPackage ../development/libraries/libchardet { }; + libcrafter = callPackage ../development/libraries/libcrafter { }; + libuchardet = callPackage ../development/libraries/libuchardet { }; libchop = callPackage ../development/libraries/libchop { };