From 11175a4c8b0ea4a87905445f1fcbf52b8a184bec Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 29 Sep 2021 15:36:13 +0800 Subject: [PATCH] masscan: enable selftest and minor cleanups --- pkgs/tools/security/masscan/default.nix | 28 +++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/security/masscan/default.nix b/pkgs/tools/security/masscan/default.nix index 891311ddaa03..46bae3c20c51 100644 --- a/pkgs/tools/security/masscan/default.nix +++ b/pkgs/tools/security/masscan/default.nix @@ -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; {