Update net-analyzer/nmap to v7.92

This commit is contained in:
Aniruddha Basak 2021-10-22 10:39:57 +00:00
parent de74177fc6
commit 261b2337df
13 changed files with 535 additions and 534 deletions

View File

@ -1,3 +1,5 @@
DIST nmap-7.40.tar.bz2 9043221 SHA256 9e14665fffd054554d129d62c13ad95a7b5c7a046daa2290501909e65f4d3188 SHA512 98e37bf1c29789ea19ee4542d719ed6970c8bcc1bf92af4948a52a75273c2403329149f6b5df6368c23840d1bb3f47af9e5ce543f7a36596a33896609574f02d WHIRLPOOL 735133455aec227149478cb273e41d33b7dbd77a6998682b6d80bdc72c77555cd745895adfcde1c194281c258131e7fce49254e79349fe112a5f146768fd1c51
DIST nmap-7.50.tar.bz2 9309616 SHA256 e9a96a8e02bfc9e80c617932acc61112c23089521ee7d6b1502ecf8e3b1674b2 SHA512 b74c5711f03bae363164cdb7e62923ab938c81c7bbcd080eaa2d1acc89f09eb0a7e0f5deb9628b81057c7a35ecd487a2d09dfe3b58b0db6c84cf0b39f526e5f2 WHIRLPOOL 9fd0a9fb8de6e4e169cf7a9ce8b06b3e245f66aa3643cb6be4b1933d824091d4211d3207893f5bff5621c7746434db92a5745c3500e3ce8de1bb0c6e2820d365
DIST nmap-logo-64.png 3289 SHA256 4c72ff1eeffeeaa1039b251d9f2d675936e65db686fe3b57a35c2183ce67a8aa SHA512 fb102d12aaeebc8a97543ecd653a3606e86996ad679bc26d6e6e274ad05ec3e9f92521289d1a24153c521b699e8c0cfa65d8856bb49af53ee4837268bbc6b5d3 WHIRLPOOL 6093aadcb9880587e17d39d45fcbe57bb62777f220655e6ed5b5f900ce49cb8c5a53e24d7db0de6f8909eb0f8981f7565e6ae9b9bf9283a4ccccb0526eab5313
DIST nmap-7.80.tar.bz2 10550327 BLAKE2B 513a5589f4dd72660d290cc03b8130da2c41e4620c5a82e125e4345259b8d0f6efa8bceef47d3c0d2b5b588888b716070e05105a09b0185622aed9268715ae2c SHA512 d4384d3ebf4f3abf3588eed5433f733874ecdceb9342a718dc36db19634b0cc819d73399974eb0a9a9c9dd9e5c88473e07644ec91db28b0c072552b54430be6b
DIST nmap-7.91.tar.bz2 10503500 BLAKE2B a758e0a20f8243b33b000c23e025b87bdb712390b82982a1aca219c9b98cd55c6ababb810328c7d0cdb5c884ef9bd5b187b9e4929454278342d7ee5ef441cded SHA512 9d59f031b5f748311e9f9a0b9d05ad4a7a70fc6ac17598d7c4c81a4825c95d53817d74435d839e67b9379a052f2d37889fd634f9c75301a851f465d60fb9974d
DIST nmap-7.91.tar.bz2.asc 195 BLAKE2B 16c4bad309c4652128a67f00c6b89f6552f432166733cac45756c20df0f48bdd0b8b9edbcce3df8f25d0a8e422be2494d9d5639fa74fc3f1e2c13489c52387c1 SHA512 376b74fc15896a1008709dac45b5af5d35ca00a1753994aba3ee6cffe2c2f0d67619fab45d57e83b454cfb376defe965f2bf881ef4cb8d5f8f2215979ad8ee96
DIST nmap-7.92.tar.bz2 10498200 BLAKE2B 0f3022e797ffca7d1d3497990c86bb60ac9a80bb93cb4ec7fcfa4f51782cb8d79d4f0aca0fa6119bfd604cfe7b89af3d4223ce13ad3e6c948c021909aebd956b SHA512 7828367f9dc76ff4d1e8c821260e565fb0c3cb6aba0473d24759133a3006cdf2cb087574f0dd7d2ba47a63754ba4f72e0b78cdae1333a58f05c41d428b56ad59
DIST nmap-7.92.tar.bz2.asc 195 BLAKE2B a8052138e58cd8009341a5f3fb3a31f55af9383b9dbb6c7ce858d80541e000b17953c053e9a3a6d86a5551244cf13f181e6e3943095b86335cbb5dae96e20bdd SHA512 300a22ab097bbff67de354de6b22a8e3287f95dd6318fcabd546ba52158e9589b19ede175587c6e31518c47bc118c7dd05db43755def075d810b16945b65e05a

View File

@ -0,0 +1,26 @@
--- a/configure.ac
+++ b/configure.ac
@@ -468,7 +468,6 @@
fi
if test $have_libpcap != yes; then
- AC_CONFIG_SUBDIRS(libpcap)
if test "${LIBPCAP_INC+set}" = "set"; then
CPPFLAGS="$CPPFLAGS -I$LIBPCAP_INC"
else
@@ -611,7 +610,6 @@
fi
if test $have_libz != yes; then
- AC_CONFIG_SUBDIRS(libz)
# TODO: This doesn't work because libssh2's configure script is looking for
# already-built libs. Giving up for now: build libz first or install
# headers/libs on your own if you want compression support for SSH.
@@ -697,7 +695,6 @@
# If we still don't have it, we use our own
if test $have_libssh2 != yes; then
have_libssh2=yes
- AC_CONFIG_SUBDIRS(libssh2)
CPPFLAGS="-I\$(top_srcdir)/$LIBSSH2DIR/include $CPPFLAGS"
LIBSSH2_LIBS="$LIBSSH2DIR/lib/libssh2.a"
LIBSSH2_BUILD="build-libssh2"

View File

@ -0,0 +1,37 @@
https://bugs.gentoo.org/770808
https://github.com/nmap/nmap/commit/169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689
From 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689 Mon Sep 17 00:00:00 2001
From: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Thu, 19 Nov 2020 17:34:24 +0000
Subject: [PATCH] Restore call to post_connect in non-ssl case. Fixes #2149
---
ncat/ncat_connect.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c
index 606eac412f..f59dd4372f 100644
--- a/ncat/ncat_connect.c
+++ b/ncat/ncat_connect.c
@@ -1064,12 +1064,17 @@ int ncat_connect(void)
bye("Failed to set hostname on iod.");
if (o.ssl)
{
+ /* connect_handler creates stdin_nsi and calls post_connect */
nsock_reconnect_ssl(mypool, cs.sock_nsi, connect_handler, o.conntimeout, NULL, NULL);
}
+ else
+ {
+ /* Create IOD for nsp->stdin */
+ if ((cs.stdin_nsi = nsock_iod_new2(mypool, 0, NULL)) == NULL)
+ bye("Failed to create stdin nsiod.");
- /* Create IOD for nsp->stdin */
- if ((cs.stdin_nsi = nsock_iod_new2(mypool, 0, NULL)) == NULL)
- bye("Failed to create stdin nsiod.");
+ post_connect(mypool, cs.sock_nsi);
+ }
}
/* connect */

View File

@ -0,0 +1,30 @@
https://bugs.gentoo.org/765148
https://github.com/nmap/nmap/commit/f6b40614e4a8131394792d590965f8af3c635323
From f6b40614e4a8131394792d590965f8af3c635323 Mon Sep 17 00:00:00 2001
From: nnposter <nnposter@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Fri, 16 Oct 2020 02:54:52 +0000
Subject: [PATCH] Fix a Unix domain socket crash. Fixes #2154
diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c
index 8942d83cb9..2792a6ac24 100644
--- a/ncat/ncat_main.c
+++ b/ncat/ncat_main.c
@@ -846,7 +846,7 @@ int main(int argc, char *argv[])
targetaddrs->addr.un.sun_family = AF_UNIX;
strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path));
targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un);
- o.target = argv[optind];
+ o.sslservername = o.target = argv[optind];
optind++;
} else
#endif
@@ -865,7 +865,7 @@ int main(int argc, char *argv[])
targetaddrs->addr.vm.svm_cid = long_cid;
targetaddrs->addrlen = sizeof(targetaddrs->addr.vm);
- o.target = argv[optind];
+ o.sslservername = o.target = argv[optind];
optind++;
}
} else

View File

@ -0,0 +1,66 @@
--- a/nbase/Makefile.in
+++ b/nbase/Makefile.in
@@ -12,7 +12,7 @@
CCOPT =
DEFS = @DEFS@
# With GCC, add extra security checks to source code.
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ $(CCOPT) $(GLIB_CFLAGS) $(DEFS) $(INCLS)
STATIC =
--- a/ncat/Makefile.in
+++ b/ncat/Makefile.in
@@ -53,7 +53,7 @@
LIBS = @LIBS@
DEFS = @DEFS@ -DNCAT_DATADIR="\"$(pkgdatadir)\""
# With GCC, add extra security checks to source code.
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
INCLS = -I. -I.. -I../nsock/include/ -I$(NBASEDIR)
RM = rm -f
STRIP = @STRIP@
--- a/nsock/src/Makefile.in
+++ b/nsock/src/Makefile.in
@@ -13,7 +13,7 @@
CCOPT =
DEFS = @DEFS@ -DNSOCK_VERSION=\"$(NSOCK_VERSION)\"
# With GCC, add extra security checks to source code.
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
INCLS = -I../include
CFLAGS = @CFLAGS@ $(CCOPT)
# CFLAGS = -g -Wall $(DEFS) $(INCLS)
--- a/libnetutil/Makefile.in
+++ b/libnetutil/Makefile.in
@@ -5,7 +5,7 @@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@ $(DEFS)
DEFS = @DEFS@
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
AR = ar
RANLIB = @RANLIB@
--- a/Makefile.in
+++ b/Makefile.in
@@ -41,7 +41,7 @@
# http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
# Level 1 only makes changes that don't affect "conforming" programs,
# while level 2 enforces additional restrictions.
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
# For mtrace debugging -- see MTRACE define in main.cc for instructions
# Should only be enabled during debugging and not in any real release.
# DEFS += -DMTRACE=1
--- a/nping/Makefile.in
+++ b/nping/Makefile.in
@@ -38,7 +38,7 @@
# http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
# Level 1 only makes changes that don't affect "conforming" programs,
# while level 2 enforces additional restrictions.
-DEFS += -D_FORTIFY_SOURCE=2
+DEFS +=
# For mtrace debugging -- see MTRACE define in main.cc for instructions
# Should only be enabled during debugging and not in any real release.
# DEFS += -DMTRACE=1

View File

@ -0,0 +1,11 @@
--- a/libnetutil/netutil.cc
+++ b/libnetutil/netutil.cc
@@ -2571,7 +2571,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) {
/* CASE 4: where we (finally!) have a full 20 byte TCP header so we can
* safely print all fields */
- else { /* if (datalen >= 20) */
+ else if (datalen >= 20) {
/* TCP Flags */
p = tflags;

View File

@ -1,17 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>netmon@gentoo.org</email>
<name>Gentoo network monitoring and analysis project</name>
<maintainer type="person">
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
<maintainer type="person">
<email>dilfridge@gentoo.org</email>
<name>Andreas K. Hüttel</name>
</maintainer>
<maintainer type="person">
<email>zlogene@gentoo.org</email>
<name>Mikle Kolyada</name>
</maintainer>
<use>
<flag name="system-lua">Use <pkg>dev-lang/lua</pkg> instead of the bundled liblua</flag>
<flag name="libssh2">Enable SSH support through <pkg>net-libs/libssh2</pkg></flag>
<flag name="ncat">Install the ncat utility</flag>
<flag name="ndiff">Install the ndiff utility</flag>
<flag name="nmap-update">Install nmap-update, which uses <pkg>dev-vcs/subversion</pkg> to update nmap scripts in your home directory</flag>
<flag name="nping">Install the nping utility</flag>
<flag name="nse">Include support for the Nmap Scripting Engine (NSE)</flag>
<flag name="zenmap">Install the GTK+ based nmap GUI, zenmap</flag>
<flag name="system-lua">Use <pkg>dev-lang/lua</pkg> instead of the bundled liblua</flag>
</use>
</pkgmetadata>

View File

@ -1,180 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite,xml"
inherit autotools flag-o-matic python-single-r1 toolchain-funcs
MY_P=${P/_beta/BETA}
DESCRIPTION="A utility for network discovery and security auditing"
HOMEPAGE="http://nmap.org/"
SRC_URI="
http://nmap.org/dist/${MY_P}.tar.bz2
https://dev.gentoo.org/~jer/nmap-logo-64.png
"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="ipv6 libressl +nse system-lua ncat ndiff nls nmap-update nping ssl zenmap"
NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh )
IUSE+=" ${NMAP_LINGUAS[@]/#/linguas_}"
REQUIRED_USE="
system-lua? ( nse )
ndiff? ( ${PYTHON_REQUIRED_USE} )
zenmap? ( ${PYTHON_REQUIRED_USE} )
"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
zenmap? (
dev-python/pygtk:2[${PYTHON_USEDEP}]
${PYTHON_DEPS}
)
system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
ndiff? ( ${PYTHON_DEPS} )
nls? ( virtual/libintl )
nmap-update? ( dev-libs/apr dev-vcs/subversion )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:= )
)
"
DEPEND="
${RDEPEND}
nls? ( sys-devel/gettext )
"
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
"${FILESDIR}"/${PN}-6.46-uninstaller.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-7.25-no-FORTIFY_SOURCE.patch
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
)
pkg_setup() {
if use ndiff || use zenmap; then
python-single-r1_pkg_setup
fi
}
src_unpack() {
# prevent unpacking the logo
unpack ${MY_P}.tar.bz2
}
src_prepare() {
rm -r libpcap/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
if use nls; then
local lingua=''
for lingua in ${NMAP_LINGUAS[@]}; do
if ! use linguas_${lingua}; then
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
fi
done
else
# configure/make ignores --disable-nls
for lingua in ${NMAP_LINGUAS[@]}; do
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
done
fi
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
sed -i \
-e '/rm -f $@/d' \
$(find . -name Makefile.in) \
|| die
# Fix desktop files wrt bug #432714
sed -i \
-e '/^Encoding/d' \
-e 's|^Categories=.*|Categories=Network;System;Security;|g' \
zenmap/install_scripts/unix/zenmap-root.desktop \
zenmap/install_scripts/unix/zenmap.desktop || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
fi
}
src_configure() {
# The bundled libdnet is incompatible with the version available in the
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_enable nls) \
$(use_with zenmap) \
$(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
$(use_with ncat) \
$(use_with ndiff) \
$(use_with nmap-update) \
$(use_with nping) \
$(use_with ssl openssl) \
--with-libdnet=included \
--with-pcre=/usr
# --with-liblinear=/usr \
# Commented because configure does weird things, while autodetection works
}
src_compile() {
local directory
for directory in . libnetutil nsock/src \
$(usex ncat ncat '') \
$(usex nmap-update nmap-update '') \
$(usex nping nping '')
do
emake -C "${directory}" makefile.dep
done
emake \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB)
}
src_install() {
LC_ALL=C emake -j1 \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
if use nmap-update;then
LC_ALL=C emake -j1 \
-C nmap-update \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
fi
dodoc CHANGELOG HACKING docs/README docs/*.txt
if use zenmap; then
doicon "${DISTDIR}/nmap-logo-64.png"
python_optimize
fi
}

View File

@ -1,180 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite,xml"
inherit autotools flag-o-matic python-single-r1 toolchain-funcs
MY_P=${P/_beta/BETA}
DESCRIPTION="A utility for network discovery and security auditing"
HOMEPAGE="http://nmap.org/"
SRC_URI="
http://nmap.org/dist/${MY_P}.tar.bz2
https://dev.gentoo.org/~jer/nmap-logo-64.png
"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="ipv6 libressl +nse system-lua ncat ndiff nls nmap-update nping ssl zenmap"
NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh )
IUSE+=" ${NMAP_LINGUAS[@]/#/linguas_}"
REQUIRED_USE="
system-lua? ( nse )
ndiff? ( ${PYTHON_REQUIRED_USE} )
zenmap? ( ${PYTHON_REQUIRED_USE} )
"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
zenmap? (
dev-python/pygtk:2[${PYTHON_USEDEP}]
${PYTHON_DEPS}
)
system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
ndiff? ( ${PYTHON_DEPS} )
nls? ( virtual/libintl )
nmap-update? ( dev-libs/apr dev-vcs/subversion )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:= )
)
"
DEPEND="
${RDEPEND}
nls? ( sys-devel/gettext )
"
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
"${FILESDIR}"/${PN}-6.46-uninstaller.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-7.25-no-FORTIFY_SOURCE.patch
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
)
pkg_setup() {
if use ndiff || use zenmap; then
python-single-r1_pkg_setup
fi
}
src_unpack() {
# prevent unpacking the logo
unpack ${MY_P}.tar.bz2
}
src_prepare() {
rm -r libpcap/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
if use nls; then
local lingua=''
for lingua in ${NMAP_LINGUAS[@]}; do
if ! use linguas_${lingua}; then
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
fi
done
else
# configure/make ignores --disable-nls
for lingua in ${NMAP_LINGUAS[@]}; do
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
done
fi
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
sed -i \
-e '/rm -f $@/d' \
$(find . -name Makefile.in) \
|| die
# Fix desktop files wrt bug #432714
sed -i \
-e 's|^Categories=.*|Categories=Network;System;Security;|g' \
zenmap/install_scripts/unix/zenmap-root.desktop \
zenmap/install_scripts/unix/zenmap.desktop || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
fi
}
src_configure() {
# The bundled libdnet is incompatible with the version available in the
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_enable nls) \
$(use_with ncat) \
$(use_with ndiff) \
$(use_with nmap-update) \
$(use_with nping) \
$(use_with ssl openssl) \
$(use_with zenmap) \
$(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
--cache-file="${S}"/config.cache \
--with-libdnet=included \
--with-pcre=/usr
# Commented out because configure does weird things
# --with-liblinear=/usr \
}
src_compile() {
local directory
for directory in . libnetutil nsock/src \
$(usex ncat ncat '') \
$(usex nmap-update nmap-update '') \
$(usex nping nping '')
do
emake -C "${directory}" makefile.dep
done
emake \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB)
}
src_install() {
LC_ALL=C emake -j1 \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
if use nmap-update;then
LC_ALL=C emake -j1 \
-C nmap-update \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
fi
dodoc CHANGELOG HACKING docs/README docs/*.txt
if use zenmap; then
doicon "${DISTDIR}/nmap-logo-64.png"
python_optimize
fi
}

View File

@ -1,58 +1,41 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=7
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite,xml"
inherit autotools flag-o-matic python-single-r1 toolchain-funcs
LUA_COMPAT=( lua5-3 )
LUA_REQ_USE="deprecated"
MY_P=${P/_beta/BETA}
inherit autotools lua-single toolchain-funcs
DESCRIPTION="A utility for network discovery and security auditing"
HOMEPAGE="http://nmap.org/"
SRC_URI="
http://nmap.org/dist/${MY_P}.tar.bz2
https://dev.gentoo.org/~jer/nmap-logo-64.png
"
DESCRIPTION="Network exploration tool and security / port scanner"
HOMEPAGE="https://nmap.org/"
SRC_URI="https://nmap.org/dist/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="ipv6 libressl +nse system-lua ncat ndiff nls nmap-update nping ssl zenmap"
NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh )
IUSE+=" ${NMAP_LINGUAS[@]/#/linguas_}"
REQUIRED_USE="
system-lua? ( nse )
ndiff? ( ${PYTHON_REQUIRED_USE} )
zenmap? ( ${PYTHON_REQUIRED_USE} )
"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
IUSE="ipv6 libssh2 ncat nmap-update nping +nse ssl +system-lua"
REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
zenmap? (
dev-python/pygtk:2[${PYTHON_USEDEP}]
${PYTHON_DEPS}
libssh2? (
net-libs/libssh2[zlib]
sys-libs/zlib
)
system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
ndiff? ( ${PYTHON_DEPS} )
nls? ( virtual/libintl )
nmap-update? ( dev-libs/apr dev-vcs/subversion )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:= )
nmap-update? (
dev-libs/apr
dev-vcs/subversion
)
nse? ( sys-libs/zlib )
ssl? ( dev-libs/openssl:0= )
system-lua? ( ${LUA_DEPS} )
"
DEPEND="
${RDEPEND}
nls? ( sys-devel/gettext )
"
DEPEND="${RDEPEND}"
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
@ -62,51 +45,23 @@ PATCHES=(
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
"${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
)
pkg_setup() {
if use ndiff || use zenmap; then
python-single-r1_pkg_setup
fi
}
src_unpack() {
# prevent unpacking the logo
unpack ${MY_P}.tar.bz2
use system-lua && lua-single_pkg_setup
}
src_prepare() {
rm -r libpcap/ || die
rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
if use nls; then
local lingua=''
for lingua in ${NMAP_LINGUAS[@]}; do
if ! use linguas_${lingua}; then
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
fi
done
else
# configure/make ignores --disable-nls
for lingua in ${NMAP_LINGUAS[@]}; do
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
done
fi
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
sed -i \
-e '/rm -f $@/d' \
$(find . -name Makefile.in) \
|| die
# Fix desktop files wrt bug #432714
sed -i \
-e 's|^Categories=.*|Categories=Network;System;Security;|g' \
@ -114,7 +69,9 @@ src_prepare() {
zenmap/install_scripts/unix/zenmap.desktop || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
@ -126,14 +83,16 @@ src_configure() {
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_enable nls) \
$(use_with libssh2) \
$(use_with ncat) \
$(use_with ndiff) \
--without-ndiff \
$(use_with nmap-update) \
$(use_with nping) \
$(use_with ssl openssl) \
$(use_with zenmap) \
$(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
--without-zenmap \
$(usex libssh2 --with-zlib) \
$(usex nse --with-zlib) \
$(usex nse --with-liblua=$(usex system-lua yes included '' '') --without-liblua) \
--cache-file="${S}"/config.cache \
--with-libdnet=included \
--with-pcre=/usr
@ -172,9 +131,4 @@ src_install() {
fi
dodoc CHANGELOG HACKING docs/README docs/*.txt
if use zenmap; then
doicon "${DISTDIR}/nmap-logo-64.png"
python_optimize
fi
}

View File

@ -0,0 +1,132 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
LUA_COMPAT=( lua5-3 )
LUA_REQ_USE="deprecated"
inherit autotools lua-single toolchain-funcs
DESCRIPTION="Network exploration tool and security / port scanner"
HOMEPAGE="https://nmap.org/"
if [[ ${PV} == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/nmap/nmap"
# Just in case for now as future seems undecided.
LICENSE="NPSL"
else
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/nmap.asc
inherit verify-sig
SRC_URI="https://nmap.org/dist/${P}.tar.bz2"
SRC_URI+=" verify-sig? ( https://nmap.org/dist/sigs/${P}.tar.bz2.asc )"
LICENSE="|| ( NPSL GPL-2 )"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
fi
SLOT="0"
IUSE="ipv6 libssh2 ncat nping +nse ssl +system-lua"
REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
libssh2? (
net-libs/libssh2[zlib]
sys-libs/zlib
)
nse? ( sys-libs/zlib )
ssl? ( dev-libs/openssl:0= )
system-lua? ( ${LUA_DEPS} )
"
DEPEND="${RDEPEND}"
if [[ ${PV} != *9999* ]] ; then
BDEPEND+="verify-sig? ( app-crypt/openpgp-keys-nmap )"
fi
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
"${FILESDIR}"/${PN}-6.46-uninstaller.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
"${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
"${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch
"${FILESDIR}"/${P}-ncat-proxy.patch
"${FILESDIR}"/${P}-ncat-unix-sockets.patch
)
pkg_setup() {
use system-lua && lua-single_pkg_setup
}
src_prepare() {
rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
fi
}
src_configure() {
# The bundled libdnet is incompatible with the version available in the
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_with libssh2) \
$(use_with ncat) \
$(use_with nping) \
$(use_with ssl openssl) \
$(usex libssh2 --with-zlib) \
$(usex nse --with-liblua=$(usex system-lua yes included '' '') --without-liblua) \
$(usex nse --with-zlib) \
--cache-file="${S}"/config.cache \
--with-libdnet=included \
--with-pcre=/usr \
--without-ndiff \
--without-zenmap
}
src_compile() {
local directory
for directory in . libnetutil nsock/src \
$(usex ncat ncat '') \
$(usex nping nping '')
do
emake -C "${directory}" makefile.dep
done
emake \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB)
}
src_install() {
LC_ALL=C emake -j1 \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
dodoc CHANGELOG HACKING docs/README docs/*.txt
}

View File

@ -0,0 +1,131 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
LUA_COMPAT=( lua5-3 )
LUA_REQ_USE="deprecated"
inherit autotools lua-single toolchain-funcs
DESCRIPTION="Network exploration tool and security / port scanner"
HOMEPAGE="https://nmap.org/"
if [[ ${PV} == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/nmap/nmap"
# Just in case for now as future seems undecided.
LICENSE="NPSL"
else
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/nmap.asc
inherit verify-sig
SRC_URI="https://nmap.org/dist/${P}.tar.bz2"
SRC_URI+=" verify-sig? ( https://nmap.org/dist/sigs/${P}.tar.bz2.asc )"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
LICENSE="|| ( NPSL GPL-2 )"
fi
SLOT="0"
IUSE="ipv6 libssh2 ncat nping +nse ssl +system-lua"
REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
libssh2? (
net-libs/libssh2[zlib]
sys-libs/zlib
)
nse? ( sys-libs/zlib )
ssl? ( dev-libs/openssl:0= )
system-lua? ( ${LUA_DEPS} )
"
DEPEND="${RDEPEND}"
if [[ ${PV} != *9999* ]] ; then
BDEPEND+="verify-sig? ( app-crypt/openpgp-keys-nmap )"
fi
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
"${FILESDIR}"/${PN}-6.46-uninstaller.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
"${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
"${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch
)
pkg_setup() {
use system-lua && lua-single_pkg_setup
}
src_prepare() {
rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
fi
}
src_configure() {
# The bundled libdnet is incompatible with the version available in the
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_with libssh2) \
$(use_with ncat) \
$(use_with nping) \
$(use_with ssl openssl) \
$(usex libssh2 --with-zlib) \
$(usex nse --with-liblua=$(usex system-lua yes included '' '') --without-liblua) \
$(usex nse --with-zlib) \
--cache-file="${S}"/config.cache \
--with-libdnet=included \
--with-pcre="${ESYSROOT}"/usr \
--without-ndiff \
--without-zenmap
}
src_compile() {
local directory
for directory in . libnetutil nsock/src \
$(usex ncat ncat '') \
$(usex nping nping '')
do
emake -C "${directory}" makefile.dep
done
emake \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB)
}
src_install() {
LC_ALL=C emake -j1 \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
dodoc CHANGELOG HACKING docs/README docs/*.txt
}

View File

@ -1,107 +1,87 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=7
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite,xml"
inherit autotools flag-o-matic git-r3 python-single-r1 toolchain-funcs user
LUA_COMPAT=( lua5-3 )
LUA_REQ_USE="deprecated"
inherit autotools lua-single toolchain-funcs
MY_P=${P/_beta/BETA}
DESCRIPTION="Network exploration tool and security / port scanner"
HOMEPAGE="https://nmap.org/"
if [[ ${PV} == *9999* ]] ; then
inherit git-r3
DESCRIPTION="A utility for network discovery and security auditing"
HOMEPAGE="http://nmap.org/"
EGIT_REPO_URI="https://github.com/nmap/nmap"
EGIT_REPO_URI="https://github.com/nmap/nmap"
SRC_URI="https://dev.gentoo.org/~jer/nmap-logo-64.png"
# Just in case for now as future seems undecided.
LICENSE="NPSL"
else
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/nmap.asc
inherit verify-sig
SRC_URI="https://nmap.org/dist/${P}.tar.bz2"
SRC_URI+=" verify-sig? ( https://nmap.org/dist/sigs/${P}.tar.bz2.asc )"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
LICENSE="|| ( NPSL GPL-2 )"
fi
LICENSE="GPL-2"
SLOT="0"
IUSE="ipv6 libressl +nse system-lua ncat ndiff nls nmap-update nping ssl zenmap"
NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh )
IUSE+=" ${NMAP_LINGUAS[@]/#/linguas_}"
REQUIRED_USE="
system-lua? ( nse )
ndiff? ( ${PYTHON_REQUIRED_USE} )
zenmap? ( ${PYTHON_REQUIRED_USE} )
"
IUSE="ipv6 libssh2 ncat nping +nse ssl +system-lua"
REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
RDEPEND="
dev-libs/liblinear:=
dev-libs/libpcre
net-libs/libpcap
zenmap? (
dev-python/pygtk:2[${PYTHON_USEDEP}]
${PYTHON_DEPS}
)
system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
ndiff? ( ${PYTHON_DEPS} )
nls? ( virtual/libintl )
nmap-update? ( dev-libs/apr dev-vcs/subversion )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:= )
libssh2? (
net-libs/libssh2[zlib]
sys-libs/zlib
)
nse? ( sys-libs/zlib )
ssl? ( dev-libs/openssl:0= )
system-lua? ( ${LUA_DEPS} )
"
DEPEND="
${RDEPEND}
nls? ( sys-devel/gettext )
"
DEPEND="${RDEPEND}"
if [[ ${PV} != *9999* ]] ; then
BDEPEND+="verify-sig? ( app-crypt/openpgp-keys-nmap )"
fi
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}"/${PN}-5.10_beta1-string.patch
"${FILESDIR}"/${PN}-5.21-python.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-6.46-uninstaller.patch
"${FILESDIR}"/${PN}-6.25-liblua-ar.patch
"${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
"${FILESDIR}"/${PN}-7.25-libpcre.patch
"${FILESDIR}"/${PN}-7.25-no-FORTIFY_SOURCE.patch
"${FILESDIR}"/${PN}-7.31-libnl.patch
"${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
"${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch
"${FILESDIR}"/${PN}-9999-netutil-else.patch
)
pkg_setup() {
if use ndiff || use zenmap; then
python-single-r1_pkg_setup
fi
use system-lua && lua-single_pkg_setup
}
src_prepare() {
rm -r libpcap/ || die
rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
cat "${FILESDIR}"/nls.m4 >> "${S}"/acinclude.m4 || die
default
if use nls; then
local lingua=''
for lingua in ${NMAP_LINGUAS[@]}; do
if ! use linguas_${lingua}; then
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
fi
done
else
# configure/make ignores --disable-nls
for lingua in ${NMAP_LINGUAS[@]}; do
rm -r zenmap/share/zenmap/locale/${lingua} || die
rm zenmap/share/zenmap/locale/${lingua}.po || die
done
fi
sed -i \
-e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
Makefile.in || die
# Fix desktop files wrt bug #432714
sed -i \
-e 's|^Categories=.*|Categories=Network;System;Security;|g' \
zenmap/install_scripts/unix/zenmap-root.desktop \
zenmap/install_scripts/unix/zenmap.desktop || die
cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# we need the original for a Darwin-specific fix, bug #604432
mv libdnet-stripped/include/config.h.in{.nmap-orig,} || die
@ -113,26 +93,24 @@ src_configure() {
# tree, so we cannot use the system library here.
econf \
$(use_enable ipv6) \
$(use_enable nls) \
$(use_with libssh2) \
$(use_with ncat) \
$(use_with ndiff) \
$(use_with nmap-update) \
$(use_with nping) \
$(use_with ssl openssl) \
$(use_with zenmap) \
$(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
$(usex libssh2 --with-zlib) \
$(usex nse --with-liblua=$(usex system-lua yes included '' '') --without-liblua) \
$(usex nse --with-zlib) \
--cache-file="${S}"/config.cache \
--with-libdnet=included \
--with-pcre=/usr
# Commented out because configure does weird things
# --with-liblinear=/usr \
--with-pcre="${ESYSROOT}"/usr \
--without-ndiff \
--without-zenmap
}
src_compile() {
local directory
for directory in . libnetutil nsock/src \
$(usex ncat ncat '') \
$(usex nmap-update nmap-update '') \
$(usex nping nping '')
do
emake -C "${directory}" makefile.dep
@ -149,19 +127,6 @@ src_install() {
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
if use nmap-update;then
LC_ALL=C emake -j1 \
-C nmap-update \
DESTDIR="${D}" \
STRIP=: \
nmapdatadir="${EPREFIX}"/usr/share/nmap \
install
fi
dodoc CHANGELOG HACKING docs/README docs/*.txt
if use zenmap; then
doicon "${DISTDIR}/nmap-logo-64.png"
python_optimize
fi
}