From 84357dbd4f976dcf8296f1678cea043bdc007c51 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 22 Sep 2023 17:38:43 -0400 Subject: [PATCH] nmap: Add recipe for 7.94; disabled as it doesn't fully work. --- .../{nmap-7.90.recipe => nmap-7.94.recipe} | 15 +++- net-analyzer/nmap/patches/nmap-7.94.patchset | 89 +++++++++++++++++++ 2 files changed, 100 insertions(+), 4 deletions(-) rename net-analyzer/nmap/{nmap-7.90.recipe => nmap-7.94.recipe} (83%) create mode 100644 net-analyzer/nmap/patches/nmap-7.94.patchset diff --git a/net-analyzer/nmap/nmap-7.90.recipe b/net-analyzer/nmap/nmap-7.94.recipe similarity index 83% rename from net-analyzer/nmap/nmap-7.90.recipe rename to net-analyzer/nmap/nmap-7.94.recipe index e95cafa51..107faf298 100644 --- a/net-analyzer/nmap/nmap-7.90.recipe +++ b/net-analyzer/nmap/nmap-7.94.recipe @@ -16,18 +16,22 @@ transfer, redirection, and debugging tool (Ncat), a utility for comparing \ scan results (Ndiff), and a packet generation and response analysis tool \ (Nping)." HOMEPAGE="https://nmap.org/" -COPYRIGHT="1996–2020 The Nmap Project" +COPYRIGHT="1996–2023 The Nmap Project" LICENSE="GNU GPL v2" REVISION="1" SOURCE_URI="https://nmap.org/dist/nmap-$portVersion.tar.bz2" -CHECKSUM_SHA256="5557c3458275e8c43e1d0cfa5dad4e71dd39e091e2029a293891ad54098a40e8" +CHECKSUM_SHA256="d71be189eec43d7e099bac8571509d316c4577ca79491832ac3e1217bc8f92cc" +PATCHES="nmap-$portVersion.patchset" -ARCHITECTURES="?all" +# disabled: doesn't really work, needs route code +ARCHITECTURES="?all !x86_gcc2" SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" PROVIDES=" nmap$secondaryArchSuffix = $portVersion cmd:nmap$secondaryArchSuffix = $portVersion + cmd:ncat$secondaryArchSuffix = $portVersion + cmd:nping$secondaryArchSuffix = $portVersion " REQUIRES=" haiku$secondaryArchSuffix @@ -45,7 +49,9 @@ BUILD_REQUIRES=" devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" + cmd:autoconf cmd:awk + cmd:find cmd:gcc$secondaryArchSuffix cmd:ld$secondaryArchSuffix cmd:make @@ -55,11 +61,12 @@ BUILD_PREREQUIRES=" BUILD() { + export LDFLAGS=-lnetwork runConfigure ./configure make $jobArgs } INSTALL() { - make $jobArgs install + make install } diff --git a/net-analyzer/nmap/patches/nmap-7.94.patchset b/net-analyzer/nmap/patches/nmap-7.94.patchset new file mode 100644 index 000000000..b26f3851e --- /dev/null +++ b/net-analyzer/nmap/patches/nmap-7.94.patchset @@ -0,0 +1,89 @@ +From 9226c6b4fd6efaf043563c1ffe37b5a967f4682b Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +Date: Fri, 22 Sep 2023 17:37:28 -0400 +Subject: Build fixes for Haiku. + + +diff --git a/libdnet-stripped/include/dnet/route.h b/libdnet-stripped/include/dnet/route.h +index b4bd4cc..2095151 100644 +--- a/libdnet-stripped/include/dnet/route.h ++++ b/libdnet-stripped/include/dnet/route.h +@@ -14,6 +14,9 @@ + /* + * Routing table entry + */ ++#ifdef __HAIKU__ ++#define route_entry dnet_route_entry ++#endif + struct route_entry { + char intf_name[INTF_NAME_LEN]; /* interface name */ + struct addr route_dst; /* destination address */ +diff --git a/libdnet-stripped/src/addr.c b/libdnet-stripped/src/addr.c +index 7008966..628cc19 100644 +--- a/libdnet-stripped/src/addr.c ++++ b/libdnet-stripped/src/addr.c +@@ -319,12 +319,14 @@ addr_ston(const struct sockaddr *sa, struct addr *a) + # endif + #endif + case AF_UNSPEC: ++#ifndef __HAIKU__ + case ARP_HRD_ETH: /* XXX- Linux arp(7) */ + case ARP_HRD_APPLETALK: /* AppleTalk DDP */ + case ARP_HRD_INFINIBAND: /* InfiniBand */ + case ARP_HDR_IEEE80211: /* IEEE 802.11 */ + case ARP_HRD_IEEE80211_PRISM: /* IEEE 802.11 + prism header */ + case ARP_HRD_IEEE80211_RADIOTAP: /* IEEE 802.11 + radiotap header */ ++#endif + a->addr_type = ADDR_TYPE_ETH; + a->addr_bits = ETH_ADDR_BITS; + memcpy(&a->addr_eth, sa->sa_data, ETH_ADDR_LEN); +diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc +index ff7279e..4e05237 100644 +--- a/libnetutil/netutil.cc ++++ b/libnetutil/netutil.cc +@@ -130,7 +130,12 @@ typedef unsigned __int8 u_int8_t; + #include + #define NETINET_IP_H + #endif ++ ++#ifndef __HAIKU__ + #include ++#else ++#define ARPHRD_ETHER 1 /* ethernet hardware format */ ++#endif + + #if HAVE_SYS_RESOURCE_H + #include +diff --git a/ncat/sockaddr_u.h b/ncat/sockaddr_u.h +index 069e2c2..353b00a 100644 +--- a/ncat/sockaddr_u.h ++++ b/ncat/sockaddr_u.h +@@ -74,6 +74,11 @@ + #endif + #if HAVE_SYS_UN_H + # include ++ ++#ifndef SUN_LEN ++#define SUN_LEN(ptr) ((sizeof(*(ptr)) - sizeof((ptr)->sun_path)) \ ++ + strlen((ptr)->sun_path)) ++#endif + #endif + #if HAVE_LINUX_VM_SOCKETS_H + #include +diff --git a/struct_ip.h b/struct_ip.h +index 34c2602..cd47296 100644 +--- a/struct_ip.h ++++ b/struct_ip.h +@@ -50,7 +50,9 @@ typedef unsigned __int8 u_int8_t; + #include + #define NETINET_IP_H + #endif ++#ifndef __HAIKU__ + #include ++#endif + + #ifndef WIN32 + #include +-- +2.37.3 +