From a97e9d4d9c9d00c072bdc6bc6138e33e0749de7c Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 3 Aug 2021 13:46:51 -0500 Subject: [PATCH] bind_utils: Add initial port work. Not 100% yet * Provides the standard dig,host,nslookup tools * While working, it's having trouble finding haiku's default resolvers. Manually passing @8.8.8.8 fixes resolution and it works as expected * Flagged unknown on all platforms for now --- net-dns/bind_utils/bind_utils-9.16.19.recipe | 71 ++++++++++++++++++ .../patches/bind_utils-9.16.19.patchset | 75 +++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 net-dns/bind_utils/bind_utils-9.16.19.recipe create mode 100644 net-dns/bind_utils/patches/bind_utils-9.16.19.patchset diff --git a/net-dns/bind_utils/bind_utils-9.16.19.recipe b/net-dns/bind_utils/bind_utils-9.16.19.recipe new file mode 100644 index 000000000..60e6213c8 --- /dev/null +++ b/net-dns/bind_utils/bind_utils-9.16.19.recipe @@ -0,0 +1,71 @@ +SUMMARY="A collection of client side programs for DNS troubleshooting" +DESCRIPTION="bind_utils is a collection of DNS troubleshooting applications" +HOMEPAGE="https://isc.org" +COPYRIGHT="Internet Systems Consortium, Inc. ('ISC')" +LICENSE="MPL v2.0" +REVISION="1" +SOURCE_URI="ftp://ftp.isc.org/isc/bind9/$portVersion/bind-$portVersion.tar.xz" +CHECKSUM_SHA256="20bf727559302c933475904847041916bb6c279680c170babc01a76998e80ad3" +SOURCE_DIR="bind-$portVersion" +PATCHES="bind_utils-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" + +PROVIDES=" + bind_utils$secondaryArchSuffix = $portVersion + cmd:dig + cmd:host + cmd:nslookup + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libuv$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libuv$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:autom4te + cmd:automake + cmd:autoreconf + cmd:g++$secondaryArchSuffix + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:makeinfo + cmd:pkg_config + cmd:find + cmd:xargs + " + +BUILD() +{ + runConfigure ./configure --without-python + + make -C lib/dns $jobArgs + make -C lib/isc $jobArgs + make -C lib/bind9 $jobArgs + make -C lib/isccfg $jobArgs + make -C lib/irs $jobArgs + make -C bin/dig $jobArgs + make -C doc $jobArgs +} + +INSTALL() +{ + mkdir -p $docDir + + make -C bin/dig install + cp -v doc/man/{dig.1,host.1,nslookup.1} $docDir +} + +TEST() +{ + LIBS="-Wl,--as-needed -lbnetapi -lnetwork" make check +} diff --git a/net-dns/bind_utils/patches/bind_utils-9.16.19.patchset b/net-dns/bind_utils/patches/bind_utils-9.16.19.patchset new file mode 100644 index 000000000..bbbe08a4d --- /dev/null +++ b/net-dns/bind_utils/patches/bind_utils-9.16.19.patchset @@ -0,0 +1,75 @@ +From 63a8d2da718c751d8d4134b8cb9a66c80216fbfe Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Tue, 3 Aug 2021 13:10:12 -0500 +Subject: [PATCH] haiku: patch in our endian code + +* There's likely better ways to do this with + _BSD_SOURCE, but I wasn't able to get the standard + methods working +--- + lib/isc/include/isc/endian.h | 49 +++++++++++++++++++++++++++++++++++- + 1 file changed, 48 insertions(+), 1 deletion(-) + +diff --git a/lib/isc/include/isc/endian.h b/lib/isc/include/isc/endian.h +index dc770f6..e1a3c50 100644 +--- a/lib/isc/include/isc/endian.h ++++ b/lib/isc/include/isc/endian.h +@@ -11,7 +11,54 @@ + + #pragma once + +-#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ ++#if defined(__HAIKU__) ++ ++#include ++#include ++#include ++ ++/* ++ * General byte order swapping functions. ++ */ ++#define bswap16(x) __swap_int16(x) ++#define bswap32(x) __swap_int32(x) ++#define bswap64(x) __swap_int64(x) ++ ++/* ++ * Host to big endian, host to little endian, big endian to host, and little ++ * endian to host byte order functions as detailed in byteorder(9). ++ */ ++#if BYTE_ORDER == LITTLE_ENDIAN ++#define htobe16(x) bswap16((x)) ++#define htobe32(x) bswap32((x)) ++#define htobe64(x) bswap64((x)) ++#define htole16(x) ((uint16_t)(x)) ++#define htole32(x) ((uint32_t)(x)) ++#define htole64(x) ((uint64_t)(x)) ++ ++#define be16toh(x) bswap16((x)) ++#define be32toh(x) bswap32((x)) ++#define be64toh(x) bswap64((x)) ++#define le16toh(x) ((uint16_t)(x)) ++#define le32toh(x) ((uint32_t)(x)) ++#define le64toh(x) ((uint64_t)(x)) ++#else /* BYTE_ORDER != LITTLE_ENDIAN */ ++#define htobe16(x) ((uint16_t)(x)) ++#define htobe32(x) ((uint32_t)(x)) ++#define htobe64(x) ((uint64_t)(x)) ++#define htole16(x) bswap16((x)) ++#define htole32(x) bswap32((x)) ++#define htole64(x) bswap64((x)) ++ ++#define be16toh(x) ((uint16_t)(x)) ++#define be32toh(x) ((uint32_t)(x)) ++#define be64toh(x) ((uint64_t)(x)) ++#define le16toh(x) bswap16((x)) ++#define le32toh(x) bswap32((x)) ++#define le64toh(x) bswap64((x)) ++#endif /* BYTE_ORDER == LITTLE_ENDIAN */ ++ ++#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__) || defined(__bsdi__) + + #include +-- +2.30.2 +