nixpkgs/pkgs/by-name/nm/nmap/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.5 KiB
Nix
Raw Normal View History

2024-07-21 19:15:11 +01:00
{
lib,
stdenv,
fetchurl,
libpcap,
pkg-config,
openssl,
lua5_4,
pcre2,
liblinear,
2024-07-21 19:15:11 +01:00
libssh2,
zlib,
2024-07-21 19:15:11 +01:00
withLua ? true,
}:
stdenv.mkDerivation rec {
2022-04-26 15:35:10 +01:00
pname = "nmap";
2024-07-21 19:01:26 +01:00
version = "7.95";
src = fetchurl {
2016-10-27 12:55:08 +01:00
url = "https://nmap.org/dist/nmap-${version}.tar.bz2";
2024-07-21 19:01:26 +01:00
sha256 = "sha256-4Uq1MOR7Wv2I8ciiusf4nNj+a0eOItJVxbm923ocV3g=";
};
prePatch = lib.optionalString stdenv.isDarwin ''
2017-09-18 21:01:28 +01:00
substituteInPlace libz/configure \
--replace /usr/bin/libtool ar \
--replace 'AR="libtool"' 'AR="ar"' \
--replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
'';
configureFlags = [
(if withLua then "--with-liblua=${lua5_4}" else "--without-liblua")
2022-04-26 15:35:10 +01:00
"--without-ndiff"
"--without-zenmap"
];
2023-10-10 15:19:59 +01:00
postInstall = ''
install -m 444 -D nselib/data/passwords.lst $out/share/wordlists/nmap.lst
'';
makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
2018-10-19 09:30:36 +01:00
"AR=${stdenv.cc.bintools.targetPrefix}ar"
"RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib"
"CC=${stdenv.cc.targetPrefix}gcc"
];
2022-04-26 15:35:10 +01:00
nativeBuildInputs = [ pkg-config ];
2024-07-21 19:15:11 +01:00
buildInputs = [
pcre2
liblinear
2024-07-21 19:15:11 +01:00
libssh2
libpcap
openssl
zlib
2024-07-21 19:15:11 +01:00
];
enableParallelBuilding = true;
2014-01-28 17:11:00 +00:00
doCheck = false; # fails 3 tests, probably needs the net
2024-07-21 19:15:11 +01:00
meta = {
2014-11-11 13:20:43 +00:00
description = "Free and open source utility for network discovery and security auditing";
2024-07-21 19:15:11 +01:00
homepage = "http://www.nmap.org";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
thoughtpolice
fpletz
];
2014-01-28 17:11:00 +00:00
};
}