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
+10 -2
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"