summary refs log tree commit diff
path: root/pkgs/tools/networking/mdk4/default.nix
blob: 979584db432d7eb51b9ca4f2c057c9091b7c4512 (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
33
{ lib, stdenv, fetchFromGitHub, libnl, libpcap, pkg-config }:

stdenv.mkDerivation {
  pname = "mdk4";
  version = "unstable-2021-04-27";

  src = fetchFromGitHub {
    owner = "aircrack-ng";
    repo = "mdk4";
    rev = "e94422ce8e4b8dcd132d658345814df7e63bfa41";
    sha256 = "sha256-pZS7HQBKlSZJGqoZlSyBUzXC3osswcB56cBzgm+Sbwg=";
  };

  preBuild = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man

    substituteInPlace src/Makefile --replace '/usr/local/src/mdk4' '$out'
  '';

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ libnl libpcap ];

  makeFlags = [ "PREFIX=$(out)" "SBINDIR=$(PREFIX)/bin" ];

  meta = with lib; {
    description = "A tool that injects data into wireless networks";
    homepage = "https://github.com/aircrack-ng/mdk4";
    maintainers = with maintainers; [ moni ];
    license = licenses.gpl2Plus;
  };
}