summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/md/mdk4/package.nix
blob: eda72b4882fd965677ee0aca62313da5d4915c94 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  lib,
  stdenv,
  fetchFromGitHub,
  libnl,
  libpcap,
  pkg-config,
}:

stdenv.mkDerivation {
  pname = "mdk4";
  version = "4.2-unstable-2024-08-16";

  src = fetchFromGitHub {
    owner = "aircrack-ng";
    repo = "mdk4";
    rev = "36ca143a2e6c0b75b5ec60143b0c5eddd3d2970c";
    hash = "sha256-iwESQgvt9gLQeDKVkf9KcztQmjdCLOE0+Q0FlfbbjEU=";
  };

  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"
  ];

  enableParallelBuilding = true;

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