about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/nm/nmap-parse/package.nix
blob: 7a8ab044377f76fe0253e6adbcee5d1ce288e4af (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, fetchFromGitHub
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "nmap-parse";
  version = "0-unstable-2022-09-26";
  format = "other";

  src = fetchFromGitHub {
    owner = "jonny1102";
    repo = "nmap-parse";
    # https://github.com/jonny1102/nmap-parse/issues/12
    rev = "ae270ac9ce05bfbe822dbbb29411adf562d40abf";
    hash = "sha256-iaE4a5blbDPaKPRnR46+AfegXOEW88i+z/VIVGCepeM=";
  };

  propagatedBuildInputs = with python3.pkgs; [
    beautifulsoup4
    cmd2
    colorama
    ipy
    tabulate
  ];

  installPhase = ''
    runHook preInstall

    install -Dm 755 "nmap-parse.py" "$out/bin/nmap-parse"

    install -vd $out/${python3.sitePackages}/
    cp -R modules $out/${python3.sitePackages}

    runHook postInstall
  '';

  # Project has no tests
  doCheck = false;

  meta = with lib; {
    description = "Command line nmap XML parser";
    homepage = "https://github.com/jonny1102/nmap-parse";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
    mainProgram = "nmap-parse";
  };
}