pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc Add common handling for libresolv similiar to dlopen(3...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e5471b3d7b42
branches: trunk
changeset: 530643:e5471b3d7b42
user: joerg <joerg%pkgsrc.org@localhost>
date: Tue Jul 03 13:54:45 2007 +0000
description:
Add common handling for libresolv similiar to dlopen(3) wrapping.
For now, DragonFly and FreeBSD use the libc version, it is not reentrant,
but thread-safe. NetBSD 3.0+ and Darwin 8.0+ use libresolv from base
(the BIND9 resolver), all other fall back to net/bind9. Feel free to add
your favorite platform if it has a thread-safe resolver in base.
Modify mail/libspf-alf, mail/milter-greylist, mail/spamdyke and
net/nocol accordingly. Testing on !DragonFly and feedback from tron@
diffstat:
mail/libspf-alt/Makefile | 4 +-
mail/libspf-alt/buildlink3.mk | 4 +-
mail/libspf-alt/distinfo | 3 +-
mail/libspf-alt/patches/patch-aa | 56 +++++++++++++++++++++++++++++++++
mail/milter-greylist/options.mk | 4 +-
mail/spamdyke/Makefile | 3 +-
mail/spamdyke/distinfo | 6 +-
mail/spamdyke/patches/patch-ab | 9 +++--
mail/spamdyke/patches/patch-ac | 10 +++--
mk/resolv.buildlink3.mk | 66 ++++++++++++++++++++++++++++++++++++++++
net/nocol/Makefile | 3 +-
net/nocol/distinfo | 4 +-
net/nocol/patches/patch-am | 21 +++++++++++-
13 files changed, 169 insertions(+), 24 deletions(-)
diffs (truncated from 330 to 300 lines):
diff -r 2d056231af48 -r e5471b3d7b42 mail/libspf-alt/Makefile
--- a/mail/libspf-alt/Makefile Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/libspf-alt/Makefile Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2006/10/04 21:47:16 wiz Exp $
+# $NetBSD: Makefile,v 1.15 2007/07/03 13:54:45 joerg Exp $
DISTNAME= libspf_alt-0.4.0
PKGREVISION= 3
@@ -15,5 +15,5 @@
CONFIGURE_ARGS+=--with-bind=${BUILDLINK_PREFIX.bind}
.include "../../devel/gettext-lib/buildlink3.mk"
-.include "../../net/bind9/buildlink3.mk"
+.include "../../mk/resolv.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff -r 2d056231af48 -r e5471b3d7b42 mail/libspf-alt/buildlink3.mk
--- a/mail/libspf-alt/buildlink3.mk Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/libspf-alt/buildlink3.mk Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.8 2006/07/08 23:10:57 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2007/07/03 13:54:45 joerg Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
LIBSPF_ALT_BUILDLINK3_MK:= ${LIBSPF_ALT_BUILDLINK3_MK}+
@@ -18,6 +18,6 @@
.endif # LIBSPF_ALT_BUILDLINK3_MK
.include "../../devel/gettext-lib/buildlink3.mk"
-.include "../../net/bind9/buildlink3.mk"
+.include "../../mk/resolv.buildlink3.mk"
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r 2d056231af48 -r e5471b3d7b42 mail/libspf-alt/distinfo
--- a/mail/libspf-alt/distinfo Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/libspf-alt/distinfo Tue Jul 03 13:54:45 2007 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.2 2005/02/24 09:59:23 agc Exp $
+$NetBSD: distinfo,v 1.3 2007/07/03 13:54:45 joerg Exp $
SHA1 (libspf_alt-0.4.0.tar.gz) = ba269d7508daebf42e9e20720f410c9409207558
RMD160 (libspf_alt-0.4.0.tar.gz) = 67a789cfbc4df391fd6938e81ce90e3b24264615
Size (libspf_alt-0.4.0.tar.gz) = 598003 bytes
+SHA1 (patch-aa) = c2663da02cd12ff6c148f4dd2d9670e5ce71d3cb
diff -r 2d056231af48 -r e5471b3d7b42 mail/libspf-alt/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/libspf-alt/patches/patch-aa Tue Jul 03 13:54:45 2007 +0000
@@ -0,0 +1,56 @@
+$NetBSD: patch-aa,v 1.1 2007/07/03 13:54:45 joerg Exp $
+
+--- configure.orig 2007-07-02 14:03:12.000000000 +0000
++++ configure
+@@ -19389,13 +19389,13 @@ echo "${ECHO_T}$ac_cv_lib_bind_res_query
+ if test $ac_cv_lib_bind_res_query = yes; then
+ LIBS="$LIBS -lbind"
+ else
+- echo "$as_me:$LINENO: checking for res_query in -lresolv" >&5
+-echo $ECHO_N "checking for res_query in -lresolv... $ECHO_C" >&6
++ echo "$as_me:$LINENO: checking for res_query in ${RESOLV_LDFLAGS}" >&5
++echo $ECHO_N "checking for res_query in ${RESOLV_LDFLAGS}... $ECHO_C" >&6
+ if test "${ac_cv_lib_resolv_res_query+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lresolv $LIBS"
++LIBS="${RESOLV_LDFLAGS} $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -19453,7 +19453,7 @@ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_query" >&5
+ echo "${ECHO_T}$ac_cv_lib_resolv_res_query" >&6
+ if test $ac_cv_lib_resolv_res_query = yes; then
+- LIBS="$LIBS -lresolv"
++ LIBS="$LIBS ${RESOLV_LDFLAGS}"
+ else
+ echo "cannot find resolver library"; exit 1;
+ fi
+@@ -19464,13 +19464,13 @@ fi
+
+ else
+
+-echo "$as_me:$LINENO: checking for res_query in -lresolv" >&5
+-echo $ECHO_N "checking for res_query in -lresolv... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking for res_query in ${RESOLV_LDFLAGS}" >&5
++echo $ECHO_N "checking for res_query in ${RESOLV_LDFLAGS}... $ECHO_C" >&6
+ if test "${ac_cv_lib_resolv_res_query+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lresolv $LIBS"
++LIBS="${RESOLV_LDFLAGS} $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -19532,7 +19532,7 @@ if test $ac_cv_lib_resolv_res_query = ye
+ #define HAVE_LIBRESOLV 1
+ _ACEOF
+
+- LIBS="-lresolv $LIBS"
++ LIBS="${RESOLV_LDFLAGS} $LIBS"
+
+ fi
+
diff -r 2d056231af48 -r e5471b3d7b42 mail/milter-greylist/options.mk
--- a/mail/milter-greylist/options.mk Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/milter-greylist/options.mk Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2006/11/09 13:15:10 ghen Exp $
+# $NetBSD: options.mk,v 1.3 2007/07/03 13:54:45 joerg Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.milter-greylist
PKG_SUPPORTED_OPTIONS= dnsrbl drac spf
@@ -12,7 +12,7 @@
.if empty(PKG_OPTIONS:Mdnsrbl)
CONFIGURE_ARGS+= --disable-dnsrbl
.else
-CONFIGURE_ARGS+= --enable-dnsrbl
+CONFIGURE_ARGS+= --enable-dnsrbl --with-thread-safe-resolver
.endif
###
diff -r 2d056231af48 -r e5471b3d7b42 mail/spamdyke/Makefile
--- a/mail/spamdyke/Makefile Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/spamdyke/Makefile Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2007/06/21 19:08:45 schmonz Exp $
+# $NetBSD: Makefile,v 1.9 2007/07/03 13:54:45 joerg Exp $
#
DISTNAME= spamdyke-2.6.3
@@ -41,4 +41,5 @@
${INSTALL_DATA} $${f} ${PREFIX}/share/doc/${PKGBASE}; \
done
+.include "../../mk/resolv.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff -r 2d056231af48 -r e5471b3d7b42 mail/spamdyke/distinfo
--- a/mail/spamdyke/distinfo Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/spamdyke/distinfo Tue Jul 03 13:54:45 2007 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.7 2007/06/21 19:08:45 schmonz Exp $
+$NetBSD: distinfo,v 1.8 2007/07/03 13:54:46 joerg Exp $
SHA1 (spamdyke-2.6.3.tgz) = e893b319c8808bc26a649b5ec7b82dae41e64e5f
RMD160 (spamdyke-2.6.3.tgz) = 9b061fc32ee92d731db0d8ad2cf04d61829d59ac
Size (spamdyke-2.6.3.tgz) = 116041 bytes
SHA1 (patch-aa) = 9bb28e5535b28fa558ce577670e4a13324664ef4
-SHA1 (patch-ab) = e92e9ed2265debd1bf3607d83c3645a37acb4ffe
-SHA1 (patch-ac) = b8e6f4aedfcc721055c280d23019e26ac4e05ca1
+SHA1 (patch-ab) = 7297b987c9195d5c111390aaa4dfd2c82df37bac
+SHA1 (patch-ac) = 64e4f02e7ff14dee2016c33a4678eba2dc2951f0
diff -r 2d056231af48 -r e5471b3d7b42 mail/spamdyke/patches/patch-ab
--- a/mail/spamdyke/patches/patch-ab Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/spamdyke/patches/patch-ab Tue Jul 03 13:54:45 2007 +0000
@@ -1,14 +1,15 @@
-$NetBSD: patch-ab,v 1.3 2007/05/30 05:58:11 schmonz Exp $
+$NetBSD: patch-ab,v 1.4 2007/07/03 13:54:46 joerg Exp $
---- spamdyke/Makefile.orig 2007-05-24 18:55:10.000000000 -0400
+--- spamdyke/Makefile.orig 2007-05-24 22:55:10.000000000 +0000
+++ spamdyke/Makefile
@@ -1,8 +1,8 @@
#CFLAGS := -Wall -g -funsigned-char
-CFLAGS := -Wall -O2 -funsigned-char
-+CFLAGS += -Wall -O2 -funsigned-char
- LFLAGS := -lresolv
+-LFLAGS := -lresolv
-CFLAGS_TLS := -DTLS
-LFLAGS_TLS := -lssl -lcrypto
++CFLAGS += -Wall -O2 -funsigned-char
++LFLAGS := ${RESOLV_DLFAGS}
+CFLAGS_TLS ?= -DTLS
+LFLAGS_TLS ?= -lssl -lcrypto
OFILES := spamdyke.o command_line.o dns.o environment.o usage.o search_fs.o exec.o base64.o tls.o
diff -r 2d056231af48 -r e5471b3d7b42 mail/spamdyke/patches/patch-ac
--- a/mail/spamdyke/patches/patch-ac Tue Jul 03 13:35:49 2007 +0000
+++ b/mail/spamdyke/patches/patch-ac Tue Jul 03 13:54:45 2007 +0000
@@ -1,11 +1,13 @@
-$NetBSD: patch-ac,v 1.4 2007/06/08 01:08:29 schmonz Exp $
+$NetBSD: patch-ac,v 1.5 2007/07/03 13:54:46 joerg Exp $
---- utils/Makefile.orig 2007-06-05 22:51:35.000000000 -0400
+--- utils/Makefile.orig 2007-06-06 02:51:35.000000000 +0000
+++ utils/Makefile
-@@ -1,5 +1,5 @@
+@@ -1,6 +1,6 @@
#CFLAGS := -Wall -g -funsigned-char -I../spamdyke
-CFLAGS := -Wall -O2 -funsigned-char -I../spamdyke
+-LFLAGS := -lresolv
+CFLAGS += -Wall -O2 -funsigned-char -I../spamdyke
- LFLAGS := -lresolv
++LFLAGS := ${RESOLV_LDFLAGS}
all: domain2path domainsplit dnstxt dnsptr dnsmx passwordcheck
+
diff -r 2d056231af48 -r e5471b3d7b42 mk/resolv.buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/resolv.buildlink3.mk Tue Jul 03 13:54:45 2007 +0000
@@ -0,0 +1,66 @@
+# $NetBSD: resolv.buildlink3.mk,v 1.1 2007/07/03 13:54:45 joerg Exp $
+#
+# This Makefile fragment is included by package Makefiles and
+# buildlink3.mk files for the packages that need a thread-safe
+# DNS resolver..
+#
+# It defines the variables RESOLV_LDFLAGS and RESOLV_LIBS,
+# which are also exported into the CONFIGURE_ENV and MAKE_ENV environments.
+#
+# Package-settable variables:
+#
+# RESOLV_AUTO_VARS
+# When set to "yes", the necessary flags are added automatically
+# to LDFLAGS and friends.
+#
+# Default: no
+#
+# Keywords: resolv
+#
+
+RESOLV_BUILDLINK3_MK:= ${RESOLV_BUILDLINK3_MK}+
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+RESOLV_AUTO_VARS?= no
+CHECK_BUILTIN.resolv= no
+
+.if ${OPSYS} == "DragonFly" || ${OPSYS} == "FreeBSD"
+USE_BUILTIN.resolv?= yes
+
+BUILDLINK_LDFLAGS.resolv= # empty, in libc
+.elif (${OPSYS} == "NetBSD" && empty(OS_VERSION:M[012].*)) || \
+ (${OPSYS} == "Darwin" && empty(OS_VERSION:M[0123467].*))
+USE_BUILTIN.resolv?= yes
+
+# BIND 9 resolver
+BUILDLINK_LDFLAGS.resolv= -lresolv
+.else
+USE_BUILTIN.resolv?= no
+.endif
+
+.if !empty(USE_BUILTIN.resolv:M[yY][eE][sS])
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nresolv}
+BUILDLINK_PACKAGES+= resolv
+BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}resolv
+BUILDLINK_AUTO_VARS.resolv= ${RESOLV_AUTO_VARS}
+.else
+. include "../../net/bind9/buildlink3.mk"
+
+BUILDLINK_AUTO_VARS.bind= ${RESOLV_AUTO_VARS}
+BUILDLINK_LDFLAGS.resolv= ${BUILDLINK_LDFLAGS.bind}
+BUILDLINK_LIBS.resolv= ${BUILDLINK_LIBS.bind}
+.endif
+
+.if !empty(RESOLV_BUILDLINK3_MK:M+)
+#
+# Define user-visible RESOLV_{LDFLAGS,LIBS} as compiler options used
+# to link code that needs a thread-safe DNS resolver.
+#
+RESOLV_LDFLAGS= ${BUILDLINK_LDFLAGS.resolv}
+RESOLV_LIBS= ${BUILDLINK_LIBS.resolv}
+CONFIGURE_ENV+= RESOLV_LDFLAGS=${RESOLV_LDFLAGS:Q}
+CONFIGURE_ENV+= RESOLV_LIBS=${RESOLV_LIBS:Q}
+MAKE_ENV+= RESOLV_LDFLAGS=${RESOLV_LDFLAGS:Q}
+MAKE_ENV+= RESOLV_LIBS=${RESOLV_LIBS:Q}
+.endif # RESOLV_BUILDLINK3_MK
diff -r 2d056231af48 -r e5471b3d7b42 net/nocol/Makefile
--- a/net/nocol/Makefile Tue Jul 03 13:35:49 2007 +0000
+++ b/net/nocol/Makefile Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2007/02/22 19:26:57 wiz Exp $
+# $NetBSD: Makefile,v 1.32 2007/07/03 13:54:46 joerg Exp $
#
DISTNAME= nocol-4.3.1
@@ -62,4 +62,5 @@
${PREFIX}/share/nocol/gifs; \
done
+.include "../../mk/resolv.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff -r 2d056231af48 -r e5471b3d7b42 net/nocol/distinfo
--- a/net/nocol/distinfo Tue Jul 03 13:35:49 2007 +0000
+++ b/net/nocol/distinfo Tue Jul 03 13:54:45 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2005/12/27 13:47:11 joerg Exp $
+$NetBSD: distinfo,v 1.10 2007/07/03 13:54:46 joerg Exp $
SHA1 (nocol-4.3.1.tar.gz) = a8cb88727bc3a3ddd544792407d431b3ef13a325
RMD160 (nocol-4.3.1.tar.gz) = 77a57ae447f0a8f1ce2417d9b828710f21865cc8
@@ -13,7 +13,7 @@
SHA1 (patch-aj) = 0eb201f47864132b04702fab4d03e452c07c2e2a
SHA1 (patch-ak) = 8013fbe6dbff80749dbdc0d0fad391741e48a468
SHA1 (patch-al) = aa4fa83d53c72e17ea9ffe2685f326ebbbde9132
-SHA1 (patch-am) = 810cbecf5bb1f8a995579e8352be1007f09fa69e
+SHA1 (patch-am) = 395a5c446ac24cedf90783fc504c8817405d8e37
SHA1 (patch-an) = ed0e6099bdc29faf90de8b2916c858e8df57e493
SHA1 (patch-ao) = 114ebcc55d00981cc6709095f3280509880d76eb
SHA1 (patch-ap) = 45f30a886adda7831df056cf0f7a136b97a7e17d
diff -r 2d056231af48 -r e5471b3d7b42 net/nocol/patches/patch-am
Home |
Main Index |
Thread Index |
Old Index