2021-02-01 21:35:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, libpcap
|
|
|
|
}:
|
2017-02-04 17:10:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "masscan";
|
2021-02-01 21:14:53 +00:00
|
|
|
version = "1.3.2";
|
2017-02-04 17:10:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-01-27 07:22:20 +00:00
|
|
|
owner = "robertdavidgraham";
|
|
|
|
repo = "masscan";
|
|
|
|
rev = version;
|
2021-02-01 21:14:53 +00:00
|
|
|
sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
|
2017-02-04 17:10:37 +00:00
|
|
|
};
|
|
|
|
|
2021-02-01 21:35:56 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
2017-02-04 17:10:37 +00:00
|
|
|
|
2021-02-16 11:48:46 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "GITVER=${version}" "CC=${stdenv.cc.targetPrefix}cc" ];
|
2018-03-21 20:42:06 +00:00
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
'';
|
2017-02-04 17:10:37 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-02-01 21:35:56 +00:00
|
|
|
installManPage doc/masscan.8
|
|
|
|
|
2017-02-04 17:10:37 +00:00
|
|
|
mkdir -p $out/share/{doc,licenses}/masscan
|
|
|
|
mkdir -p $out/etc/masscan
|
|
|
|
|
|
|
|
cp data/exclude.conf $out/etc/masscan
|
2018-09-03 14:34:30 +01:00
|
|
|
cp -t $out/share/doc/masscan doc/algorithm.js doc/howto-afl.md doc/bot.html
|
2017-02-04 17:10:37 +00:00
|
|
|
cp LICENSE $out/share/licenses/masscan/LICENSE
|
2017-11-05 17:15:53 +00:00
|
|
|
|
|
|
|
wrapProgram $out/bin/masscan --prefix LD_LIBRARY_PATH : "${libpcap}/lib"
|
2017-02-04 17:10:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-02-04 17:10:37 +00:00
|
|
|
description = "Fast scan of the Internet";
|
2021-01-27 07:22:20 +00:00
|
|
|
homepage = "https://github.com/robertdavidgraham/masscan";
|
|
|
|
changelog = "https://github.com/robertdavidgraham/masscan/releases/tag/${version}";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
platforms = platforms.unix;
|
2017-02-04 17:10:37 +00:00
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|