new package: unbound

This commit is contained in:
Tee KOBAYASHI 2021-11-26 13:04:09 +09:00 committed by Henrik Grimler
parent 578ea03970
commit 8c49908831
3 changed files with 70 additions and 0 deletions

30
packages/unbound/build.sh Normal file
View File

@ -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"
}

View File

@ -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");

View File

@ -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;