nmap: make ndiff support python3

The ndiff is python2 compatible now, backport
a patch from debian to make ndiff port to python3.

Refer to https://sources.debian.org/data/main/n/nmap/7.80+dfsg1-2/debian/patches/0004-Python3-port-of-ndiff.patch

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Mingli Yu 2020-02-15 10:52:20 +08:00 committed by Khem Raj
parent 056dbf5548
commit 51c6ea0bc0
3 changed files with 1778 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
From 562893e665a6c9e1b60c8b3242bab6fe78318b3b Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Fri, 14 Feb 2020 08:19:54 +0000
Subject: [PATCH] configure.ac: make ndiff depend on python3
Python 2 ceased being maintained on the 1st January 2020.
We've already removed all users of it from oe-core, so
let ndiff depend on python3.
Upstream-Status: Pending
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
.../nmap/7.80-r0/nmap-7.80/configure.ac | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9d2fff8..5ffdd55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,16 +237,21 @@ if test $HAVE_PYTHON && test "x${PYTHON_VERSION%%.*}" = "x2"; then
HAVE_PYTHON2=true
fi
+HAVE_PYTHON3=false
+if test $HAVE_PYTHON && test "x${PYTHON_VERSION%%.*}" = "x3"; then
+ HAVE_PYTHON3=true
+fi
+
NDIFFDIR=ndiff
# Do they want Ndiff?
AC_ARG_WITH(ndiff, AC_HELP_STRING([--without-ndiff], [Skip installation of the Ndiff utility]), [], [with_ndiff=check])
-if $HAVE_PYTHON2 ; then : ;
+if $HAVE_PYTHON3 ; then : ;
else
if test "$with_ndiff" = "check" ; then
- AC_MSG_WARN([Not building Ndiff because Python 2.x with x>=4 was not found])
+ AC_MSG_WARN([Not building Ndiff because Python3 was not found])
elif test "$with_ndiff" = "yes"; then
- AC_MSG_FAILURE([--with-ndiff requires Python 2.x with x>=4])
+ AC_MSG_FAILURE([--with-ndiff requires Python3])
fi
with_ndiff=no
fi
--
2.24.1

View File

@ -10,6 +10,8 @@ SRC_URI = "http://nmap.org/dist/${BP}.tar.bz2 \
file://nmap-replace-shtool-mkdir-with-coreutils-mkdir-command.patch \
file://0001-Include-time.h-header-to-pass-clang-compilation.patch \
file://0002-Fix-building-with-libc.patch \
file://0001-Make-ndiff-support-python3.patch \
file://0001-configure.ac-make-ndiff-depend-on-python3.patch \
"
SRC_URI[md5sum] = "d37b75b06d1d40f27b76d60db420a1f5"
@ -28,7 +30,7 @@ PACKAGECONFIG[libz] = "--with-libz=${STAGING_LIBDIR}/.., --without-libz, zlib, z
#disable/enable packages
PACKAGECONFIG[nping] = ",--without-nping,"
PACKAGECONFIG[ncat] = ",--without-ncat,"
PACKAGECONFIG[ndiff] = ",--without-ndiff,python3"
PACKAGECONFIG[ndiff] = "--with-ndiff=yes,--without-ndiff,python3"
PACKAGECONFIG[update] = ",--without-nmap-update,"
EXTRA_OECONF = "--with-libdnet=included --with-liblinear=included --without-subversion --with-liblua=included"
@ -47,6 +49,12 @@ do_configure() {
oe_runconf
}
do_install_append() {
if [ -f "${D}${bindir}/ndiff" ]; then
sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/ndiff
fi
}
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR} ${datadir}/ncat"
RDEPENDS_${PN} = "python3"
RDEPENDS_${PN} += "python3-core"