2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, libpcap
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "masscan";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "1.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-02-05 17:12:51 +00:00
|
|
|
owner = "robertdavidgraham";
|
|
|
|
repo = "masscan";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"GITVER=${version}"
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-10-01 09:20:50 +00:00
|
|
|
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-05 17:12:51 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
wrapProgram $out/bin/masscan \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${libpcap}/lib"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
doInstallCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/masscan --selftest
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast scan of the Internet";
|
2021-02-05 17:12:51 +00:00
|
|
|
homepage = "https://github.com/robertdavidgraham/masscan";
|
|
|
|
changelog = "https://github.com/robertdavidgraham/masscan/releases/tag/${version}";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|