masscan: enable selftest and minor cleanups

This commit is contained in:
Peter Hoeg 2021-09-29 15:36:13 +08:00
parent 31ffc50c57
commit 11175a4c8b

View file

@ -19,23 +19,29 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper installShellFiles ];
makeFlags = [ "PREFIX=$(out)" "GITVER=${version}" "CC=${stdenv.cc.targetPrefix}cc" ];
makeFlags = [
"PREFIX=$(out)"
"GITVER=${version}"
"CC=${stdenv.cc.targetPrefix}cc"
];
preInstall = ''
mkdir -p $out/bin
'';
enableParallelBuilding = true;
postInstall = ''
installManPage doc/masscan.8
installManPage doc/masscan.?
mkdir -p $out/share/{doc,licenses}/masscan
mkdir -p $out/etc/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
cp data/exclude.conf $out/etc/masscan
cp -t $out/share/doc/masscan doc/algorithm.js doc/howto-afl.md doc/bot.html
cp LICENSE $out/share/licenses/masscan/LICENSE
wrapProgram $out/bin/masscan \
--prefix LD_LIBRARY_PATH : "${libpcap}/lib"
'';
wrapProgram $out/bin/masscan --prefix LD_LIBRARY_PATH : "${libpcap}/lib"
doInstallCheck = true;
installCheckPhase = ''
$out/bin/masscan --selftest
'';
meta = with lib; {