1SUMMARY = "network auditing tool"
2DESCRIPTION = "Nmap ("Network Mapper") is a free and open source (license) utility for network discovery and security auditing.\nGui support via appending to IMAGE_FEATURES x11-base in local.conf"
3SECTION = "security"
4LICENSE = "GPL-2.0-only"
5
6LIC_FILES_CHKSUM = "file://COPYING;beginline=7;endline=12;md5=66938a7e5b4c118eda78271de14874c2"
7
8SRC_URI = "http://nmap.org/dist/${BP}.tar.bz2 \
9           file://nmap-redefine-the-python-library-dir.patch \
10           file://nmap-replace-shtool-mkdir-with-coreutils-mkdir-command.patch \
11           file://0001-Include-time.h-header-to-pass-clang-compilation.patch \
12           file://0002-Fix-building-with-libc.patch \
13           file://0001-Make-ndiff-support-python3.patch \
14           file://0001-configure.ac-make-ndiff-depend-on-python3.patch \
15           "
16
17SRC_URI[md5sum] = "d37b75b06d1d40f27b76d60db420a1f5"
18SRC_URI[sha256sum] = "fcfa5a0e42099e12e4bf7a68ebe6fde05553383a682e816a7ec9256ab4773faa"
19
20inherit autotools-brokensep pkgconfig python3native
21
22PACKAGECONFIG ?= "ncat nping pcap"
23
24PACKAGECONFIG[pcap] = "--with-pcap=linux, --without-pcap, libpcap, libpcap"
25PACKAGECONFIG[pcre] = "--with-libpcre=${STAGING_LIBDIR}/.., --with-libpcre=included, libpcre"
26PACKAGECONFIG[ssl] = "--with-openssl=${STAGING_LIBDIR}/.., --without-openssl, openssl, openssl"
27PACKAGECONFIG[ssh2] = "--with-openssh2=${STAGING_LIBDIR}/.., --without-openssh2, libssh2, libssh2"
28PACKAGECONFIG[libz] = "--with-libz=${STAGING_LIBDIR}/.., --without-libz, zlib, zlib"
29
30#disable/enable packages
31PACKAGECONFIG[nping] = ",--without-nping,"
32PACKAGECONFIG[ncat] = ",--without-ncat,"
33PACKAGECONFIG[ndiff] = "--with-ndiff=yes,--without-ndiff,python3"
34PACKAGECONFIG[update] = ",--without-nmap-update,"
35
36EXTRA_OECONF = "--with-libdnet=included --with-liblinear=included --without-subversion --with-liblua=included"
37
38# zenmap needs python-pygtk which has been removed
39# it also only works with python2
40# disable for now until py3 is supported
41EXTRA_OECONF += "--without-zenmap"
42
43export PYTHON_SITEPACKAGES_DIR
44
45do_configure() {
46    autoconf
47    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
48    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
49    oe_runconf
50}
51
52do_install:append() {
53    for f in ndiff uninstall_ndiff; do
54        if [ -f ${D}${bindir}/$f ]; then
55            sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/$f
56        fi
57    done
58}
59
60FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR} ${datadir}/ncat"
61
62RDEPENDS:${PN} += " \
63    python3-difflib \
64    python3-asyncio \
65    python3-xml \
66"
67