nixpkgs/pkgs/tools/security/masscan/default.nix

61 lines
1.4 KiB
Nix
Raw Normal View History

2021-02-02 00:35:56 +03:00
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, makeWrapper
, libpcap
}:
2017-02-04 20:10:37 +03:00
stdenv.mkDerivation rec {
pname = "masscan";
2021-02-02 00:14:53 +03:00
version = "1.3.2";
2017-02-04 20:10:37 +03:00
src = fetchFromGitHub {
owner = "robertdavidgraham";
repo = "masscan";
rev = version;
2021-02-02 00:14:53 +03:00
sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
2017-02-04 20:10:37 +03:00
};
2021-11-19 22:57:28 +03:00
postPatch = lib.optionalString stdenv.isDarwin ''
# Fix broken install command
substituteInPlace Makefile --replace "-pm755" "-pDm755"
'';
2021-02-02 00:35:56 +03:00
nativeBuildInputs = [ makeWrapper installShellFiles ];
2017-02-04 20:10:37 +03:00
makeFlags = [
"PREFIX=$(out)"
"GITVER=${version}"
"CC=${stdenv.cc.targetPrefix}cc"
];
2018-03-21 23:42:06 +03:00
enableParallelBuilding = true;
2017-02-04 20:10:37 +03:00
postInstall = ''
installManPage doc/masscan.?
install -Dm444 -t $out/etc/masscan data/exclude.conf
install -Dm444 -t $out/share/doc/masscan doc/*.{html,js,md}
install -Dm444 -t $out/share/licenses/masscan LICENSE
2021-02-02 00:35:56 +03:00
wrapProgram $out/bin/masscan \
--prefix LD_LIBRARY_PATH : "${libpcap}/lib"
'';
2017-02-04 20:10:37 +03:00
doInstallCheck = true;
2017-11-05 20:15:53 +03:00
installCheckPhase = ''
$out/bin/masscan --selftest
2017-02-04 20:10:37 +03:00
'';
meta = with lib; {
2017-02-04 20:10:37 +03:00
description = "Fast scan of the Internet";
homepage = "https://github.com/robertdavidgraham/masscan";
changelog = "https://github.com/robertdavidgraham/masscan/releases/tag/${version}";
license = licenses.agpl3Only;
platforms = platforms.unix;
2017-02-04 20:10:37 +03:00
maintainers = with maintainers; [ rnhmjoj ];
};
}