2024-07-21 19:15:11 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
libpcap,
|
|
|
|
pkg-config,
|
|
|
|
openssl,
|
|
|
|
lua5_4,
|
|
|
|
pcre2,
|
2024-07-21 19:35:45 +01:00
|
|
|
liblinear,
|
2024-07-21 19:15:11 +01:00
|
|
|
libssh2,
|
2024-07-21 19:35:45 +01:00
|
|
|
zlib,
|
2024-07-21 19:15:11 +01:00
|
|
|
withLua ? true,
|
2008-05-22 12:39:30 +01:00
|
|
|
}:
|
2013-06-06 08:13:08 +01:00
|
|
|
|
2020-01-15 11:39:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-04-26 15:35:10 +01:00
|
|
|
pname = "nmap";
|
2024-07-21 19:01:26 +01:00
|
|
|
version = "7.95";
|
2007-08-04 13:49:53 +01:00
|
|
|
|
2004-08-06 11:00:53 +01:00
|
|
|
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=";
|
2008-05-22 12:39:30 +01:00
|
|
|
};
|
2007-08-04 13:49:53 +01:00
|
|
|
|
2023-01-24 16:35:54 +00:00
|
|
|
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"'
|
|
|
|
'';
|
|
|
|
|
2019-03-16 15:56:45 +00:00
|
|
|
configureFlags = [
|
2023-06-29 00:39:02 +01:00
|
|
|
(if withLua then "--with-liblua=${lua5_4}" else "--without-liblua")
|
2022-04-26 15:35:10 +01:00
|
|
|
"--without-ndiff"
|
|
|
|
"--without-zenmap"
|
|
|
|
];
|
2014-12-29 05:18:49 +00:00
|
|
|
|
2023-10-10 15:19:59 +01:00
|
|
|
postInstall = ''
|
|
|
|
install -m 444 -D nselib/data/passwords.lst $out/share/wordlists/nmap.lst
|
|
|
|
'';
|
|
|
|
|
2023-01-24 16:35:54 +00:00
|
|
|
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
|
2024-07-21 19:35:45 +01:00
|
|
|
liblinear
|
2024-07-21 19:15:11 +01:00
|
|
|
libssh2
|
|
|
|
libpcap
|
|
|
|
openssl
|
2024-07-21 19:35:45 +01:00
|
|
|
zlib
|
2024-07-21 19:15:11 +01:00
|
|
|
];
|
2017-01-21 13:25:19 +00:00
|
|
|
|
2020-01-15 11:39:52 +00:00
|
|
|
enableParallelBuilding = true;
|
2014-01-28 17:11:00 +00:00
|
|
|
|
2018-04-25 04:20:18 +01: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
|
|
|
};
|
2010-07-22 11:31:39 +01:00
|
|
|
}
|