From 8c499088317b74b339b0a3a33ec618c3b5ffbf51 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Fri, 26 Nov 2021 13:04:09 +0900 Subject: [PATCH] new package: unbound --- packages/unbound/build.sh | 30 +++++++++++++++++++ .../unbound/libunbound-libunbound.c.patch | 20 +++++++++++++ .../unbound/smallapp-unbound-host.c.patch | 20 +++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 packages/unbound/build.sh create mode 100644 packages/unbound/libunbound-libunbound.c.patch create mode 100644 packages/unbound/smallapp-unbound-host.c.patch diff --git a/packages/unbound/build.sh b/packages/unbound/build.sh new file mode 100644 index 000000000..0a57a727f --- /dev/null +++ b/packages/unbound/build.sh @@ -0,0 +1,30 @@ +TERMUX_PKG_HOMEPAGE=https://unbound.net/ +TERMUX_PKG_DESCRIPTION="A validating, recursive, caching DNS resolver" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.13.2 +TERMUX_PKG_SRCURL=https://nlnetlabs.nl/downloads/unbound/unbound-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=0a13b547f3b92a026b5ebd0423f54c991e5718037fd9f72445817f6a040e1a83 +TERMUX_PKG_DEPENDS="libevent, libexpat, libnghttp2, openssl" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +ac_cv_func_chown=no +ac_cv_func_chroot=no +ac_cv_func_getpwnam=no +--enable-event-api +--enable-ipsecmod +--enable-linux-ip-local-port-range +--enable-tfo-server +--with-libevent=$TERMUX_PREFIX +--with-libexpat=$TERMUX_PREFIX +--without-libhiredis +--without-libmnl +--with-libnghttp2=$TERMUX_PREFIX +--with-ssl=$TERMUX_PREFIX +--with-pidfile=$TERMUX_PREFIX/var/run/unbound.pid +--with-username= +" + +termux_step_post_massage() { + mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/run" +} diff --git a/packages/unbound/libunbound-libunbound.c.patch b/packages/unbound/libunbound-libunbound.c.patch new file mode 100644 index 000000000..a97d83f04 --- /dev/null +++ b/packages/unbound/libunbound-libunbound.c.patch @@ -0,0 +1,20 @@ +--- a/libunbound/libunbound.c ++++ b/libunbound/libunbound.c +@@ -1095,7 +1095,7 @@ + + if(fname == NULL) { + #if !defined(UB_ON_WINDOWS) || !defined(HAVE_WINDOWS_H) +- fname = "/etc/resolv.conf"; ++ fname = "@TERMUX_PREFIX@/etc/resolv.conf"; + #else + FIXED_INFO *info; + ULONG buflen = sizeof(*info); +@@ -1204,7 +1204,7 @@ + } + return UB_READFILE; + #else +- fname = "/etc/hosts"; ++ fname = "@TERMUX_PREFIX@/etc/hosts"; + #endif /* WIN32 */ + } + in = fopen(fname, "r"); diff --git a/packages/unbound/smallapp-unbound-host.c.patch b/packages/unbound/smallapp-unbound-host.c.patch new file mode 100644 index 000000000..1dfa07385 --- /dev/null +++ b/packages/unbound/smallapp-unbound-host.c.patch @@ -0,0 +1,20 @@ +--- a/smallapp/unbound-host.c ++++ b/smallapp/unbound-host.c +@@ -99,7 +99,7 @@ + printf(" -C config use the specified unbound.conf (none read by default)\n"); + printf(" pass as first argument if you want to override some\n"); + printf(" options with further arguments\n"); +- printf(" -r read forwarder information from /etc/resolv.conf\n"); ++ printf(" -r read forwarder information from @TERMUX_PREFIX@/etc/resolv.conf\n"); + printf(" breaks validation if the forwarder does not do DNSSEC.\n"); + printf(" -v be more verbose, shows nodata and security.\n"); + printf(" -d debug, traces the action, -d -d shows more.\n"); +@@ -462,7 +462,7 @@ + debuglevel = 2; /* at least VERB_DETAIL */ + break; + case 'r': +- check_ub_res(ub_ctx_resolvconf(ctx, "/etc/resolv.conf")); ++ check_ub_res(ub_ctx_resolvconf(ctx, "@TERMUX_PREFIX@/etc/resolv.conf")); + break; + case 't': + qtype = optarg;