use base resolver rather than libbind, based on a diff from Jeremie Le Hen

(modified to patch autoconf input file rather than generated configure script)
This commit is contained in:
sthen 2016-10-11 20:35:39 +00:00
parent 0b31fc54cf
commit c0da3858e3
3 changed files with 64 additions and 9 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.9 2015/01/26 22:42:35 sthen Exp $
# $OpenBSD: Makefile,v 1.10 2016/10/11 20:35:39 sthen Exp $
COMMENT= SPF library
DISTNAME= libspf2-1.2.10
REVISION= 0
REVISION= 1
SHARED_LIBS += spf2 4.0 # 3.0
@ -17,17 +17,15 @@ MAINTAINER= Jakob Schlyter <jakob@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM= Yes
WANTLIB= lib/libbind/bind c pthread
WANTLIB += c pthread
MODULES= devel/gettext
# requires res_close() or res_ninit()
LIB_DEPENDS= net/libbind
CONFIGURE_STYLE= gnu
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION= 2.68
CONFIGURE_ARGS= --bindir=${PREFIX}/libexec/libspf2
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include/bind" \
LDFLAGS="-L${LOCALBASE}/lib -L${LOCALBASE}/lib/libbind -Wl,-rpath ${LOCALBASE}/lib/libbind -lbind"
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib"
# broken test cases
NO_TEST= yes

View File

@ -0,0 +1,43 @@
$OpenBSD: patch-configure_ac,v 1.1 2016/10/11 20:35:39 sthen Exp $
--- configure.ac.orig Tue Oct 11 21:28:19 2016
+++ configure.ac Tue Oct 11 21:31:12 2016
@@ -111,39 +111,6 @@ AC_CHECK_HEADER(pthread.h, , [
exit 1;
])
-dnl Moved to after header checks by Shevek
-AC_ARG_WITH(bind,
- [ --with-bind=DIR Find BIND resolver in DIR],
- [AC_CHECK_FILE([$withval/include/bind/resolv.h],
- [CFLAGS="$CFLAGS -I$withval/include/bind"],
- [CFLAGS="$CFLAGS -I$withval/include"])
- LDFLAGS="$LDFLAGS -L$withval/lib -Wl,$rpath$withval/lib"
- AC_CHECK_LIB([bind], [res_query], [LIBS="$LIBS -lbind"],
- [AC_CHECK_LIB([resolv],
- [res_query],
- [LIBS="$LIBS -lresolv"],
- [echo "cannot find resolver library"; exit 1;])
- ])
- ],
- [dnl Have to include resolv.h as res_query is sometimes defined as a macro
- AC_MSG_CHECKING([for res_query in -lresolv (with resolv.h if present)])
- saved_libs="$LIBS"
- LIBS="-lresolv $LIBS"
- AC_TRY_LINK([
- #ifdef HAVE_RESOLV_H
- #include <resolv.h>
- #endif],
- [res_query(0,0,0,0,0)],
- [AC_MSG_RESULT(yes)
- have_res_query=yes],
- [AC_MSG_RESULT(no)
- LIBS="$saved_libs"])
- ])
-
-
-
-dnl [AC_CHECK_LIB(resolv, res_query)])
-
# Checks for libraries.
AC_CHECK_LIB(nsl, inet_pton)
AC_CHECK_LIB(socket, socket)

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_libspf2_spf_dns_resolv_c,v 1.3 2016/10/11 20:35:39 sthen Exp $
--- src/libspf2/spf_dns_resolv.c.orig Sat Jan 28 08:24:47 2012
+++ src/libspf2/spf_dns_resolv.c Tue Oct 11 21:28:06 2016
@@ -607,7 +607,10 @@ SPF_dns_resolv_free(SPF_dns_server_t *spf_dns_server)
SPF_ASSERT_NOTNULL(spf_dns_server);
#if ! HAVE_DECL_RES_NINIT
+# ifndef __OpenBSD__
+ /* OpenBSD's libc resolver provides res_init() but not res_close(). */
res_close();
+# endif
#endif
free(spf_dns_server);