summary refs log tree commit diff
path: root/pkgs/tools/networking/tracebox/default.nix
blob: 1fe2d25e35d0eb20cb1d980148bd0ec6ac5bb961 (plain) (blame)
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
{ stdenv, fetchzip, autoreconfHook, libcrafter, libpcap, lua }:

stdenv.mkDerivation rec {
  pname = "tracebox";
  version = "0.2";

  src = fetchzip {
    url = "https://github.com/tracebox/tracebox/archive/v${version}.zip";
    sha256 = "0gxdapm6b5a41gymi1f0nr2kyz70vllnk10085yz3pq527gp9gns";
  };

  nativeBuildInputs = [ autoreconfHook ];
  buildInputs = [ 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;
  };
}