Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2006 16:30:21 -0700 (MST)
From:      Phil Oleson <oz@nixil.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/93365: [New Port] devel/libdnsres 
Message-ID:  <200602142330.k1ENULwf077984@nixil.net>
Resent-Message-ID: <200602142340.k1ENe4A7069434@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         93365
>Category:       ports
>Synopsis:       [New Port] devel/libdnsres
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 14 23:40:04 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Phil Oleson
>Release:        FreeBSD 4.7-RELEASE-p28 i386
>Organization:
N/A
>Environment:
System: FreeBSD nixil.net 4.7-RELEASE-p28 FreeBSD 4.7-RELEASE-p28 #43: Wed Jul 20 09:35:30 MDT 2005 root@nixil:/usr/src/sys/compile/nixil i386

>Description:
	Offering a new port 'libdnsres' to the ports tree. 

        - Libdnsres provides a non-blocking thread-safe API for resolving DNS names.  It
        - requires that your main application is built on top of libevent. Libdnsres' API
        - essentially mirrors the traditional gethostbyname and getaddrinfo interfaces.
        - All return values have been replaced by callbacks instead.
        - 
        - The code borrows heavily from the BSD resolver library. In fact, it is an
        - extremely ugly hack to make the BSD resolver library non-blocking and
        - thread-safe without changing the API too much.

>How-To-Repeat:
	N/A
>Fix:

	Shar attached.

--- libdnsres.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	libdnsres
#	libdnsres/pkg-plist
#	libdnsres/pkg-descr
#	libdnsres/distinfo
#	libdnsres/Makefile
#	libdnsres/files
#	libdnsres/files/patch-dnsres.3
#	libdnsres/files/patch-test-simple_test.c
#
echo c - libdnsres
mkdir -p libdnsres > /dev/null 2>&1
echo x - libdnsres/pkg-plist
sed 's/^X//' >libdnsres/pkg-plist << 'END-of-libdnsres/pkg-plist'
Xinclude/dnsres.h
Xlib/libdnsres.a
Xlib/libdnsres.so
Xlib/libdnsres.so.0
END-of-libdnsres/pkg-plist
echo x - libdnsres/pkg-descr
sed 's/^X//' >libdnsres/pkg-descr << 'END-of-libdnsres/pkg-descr'
XLibdnsres provides a non-blocking thread-safe API for resolving DNS names.  It
Xrequires that your main application is built on top of libevent. Libdnsres' API
Xessentially mirrors the traditional gethostbyname and getaddrinfo interfaces. 
XAll return values have been replaced by callbacks instead.
X
XThe code borrows heavily from the BSD resolver library. In fact, it is an 
Xextremely ugly hack to make the BSD resolver library non-blocking and 
Xthread-safe without changing the API too much. 
X
XWWW: http://www.monkey.org/~provos/libdnsres/
X
END-of-libdnsres/pkg-descr
echo x - libdnsres/distinfo
sed 's/^X//' >libdnsres/distinfo << 'END-of-libdnsres/distinfo'
XMD5 (libdnsres-0.1a.tar.gz) = 069cc39d7ddf85c9be9ada679d5363c2
XSIZE (libdnsres-0.1a.tar.gz) = 360583
END-of-libdnsres/distinfo
echo x - libdnsres/Makefile
sed 's/^X//' >libdnsres/Makefile << 'END-of-libdnsres/Makefile'
X# New ports collection makefile for:	libdnsres
X# Date created:				Fri Feb  3 18:15:51 MST 2006
X# Whom:					Phil Oleson <oz@nixil.net>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	libdnsres
XPORTVERSION=	0.1a
XCATEGORIES=	devel
XMASTER_SITES=	http://monkey.org/~provos/
X
XMAINTAINER=	oz@nixil.net
XCOMMENT=	Provides a non-blocking thread-safe API for resolving DNS names
X
XBUILD_DEPENDS=	${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent
XGNU_CONFIGURE=	yes
XUSE_AUTOTOOLS=	libtool:15
XUSE_REINPLACE=	yes
XINSTALLS_SHLIB=	yes
X
XPLIST_SUB+=	PORTVERSION="${PORTVERSION}"
X
XMAN3=	dnsres.3
XMLINKS= dnsres.3 dnsres_init.3 dnsres.3 dnsres_gethostbyname.3 \
X	dnsres.3 dnsres_gethostbyname2.3 dnsres.3 dnsres_gethostbyaddr.3 \
X	dnsres.3 dnsres_getaddrinfo.3
X
X.include <bsd.port.pre.mk>
X
X.if ${OSVERSION} >= 700014
XBROKEN=		"Does not compile on FreeBSD >= 7.0"
X.endif
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's,CFLAGS =,CFLAGS +=,' ${WRKSRC}/Makefile.in
X
X.include <bsd.port.post.mk>
END-of-libdnsres/Makefile
echo c - libdnsres/files
mkdir -p libdnsres/files > /dev/null 2>&1
echo x - libdnsres/files/patch-dnsres.3
sed 's/^X//' >libdnsres/files/patch-dnsres.3 << 'END-of-libdnsres/files/patch-dnsres.3'
X--- dnsres.3.orig	Tue Feb 14 15:17:58 2006
X+++ dnsres.3	Tue Feb 14 16:15:58 2006
X@@ -38,17 +38,20 @@
X .Nm dnsres_getaddrinfo
X .Nd non blocking DNS resolving library
X .Sh SYNOPSIS
X+.Fd #include <sys/types.h>
X+.Fd #include <sys/socket.h>
X+.Fd #include <netdb.h>
X .Fd #include <dnsres.h>
X .Ft int
X .Fn dnsres_init "struct dnsres *_resp"
X .Ft void
X-.Fn dnsres_gethostbyname "struct dnsres* res" "const char *name" "void (*cb)(struct hostent *hp, int error, void *arg" "void *arg"
X+.Fn dnsres_gethostbyname "struct dnsres *res" "const char *name" "void (*cb)(struct hostent *hp, int error, void *arg)" "void *arg"
X .Ft void
X-.Fn dnsres_gethostbyname2 "const char *name" "int af" "void (*cb)(struct hostent *hp, int error, void *arg" "void *arg"
X+.Fn dnsres_gethostbyname2 "struct dnsres *res" "const char *name" "int af" "void (*cb)(struct hostent *hp, int error, void *arg)" "void *arg"
X .Ft void
X-.Fn dnsres_gethostbyaddr "const char *addr" "int len" "int af" "void (*cb)(struct hostent *hp, int error, void *arg" "void *arg"
X+.Fn dnsres_gethostbyaddr "struct dnsres *res" "const char *addr" "int len" "int af" "void (*cb)(struct hostent *hp, int error, void *arg)" "void *arg"
X .Ft void
X-.Fn dnsres_getaddrinfo "struct dnsres *" "const char *" "const char *" "const struct addrinfo *" "void (*)(struct addrinfo *, int, void *)" "void *";
X+.Fn dnsres_getaddrinfo "struct dnsres *res" "const char *hostname" "const char *servname" "const struct addrinfo *hints" "void (*cb)(struct addrinfo *ai, int res, void *arg)" "void *arg"
X .Sh DESCRIPTION
X The
X .Fn dnsres_init
X@@ -134,6 +137,10 @@
X The only address family currently supported is
X .Dv AF_INET .
X .Pp
X+The
X+.Fn dnsres_getaddrinfo
X+function is used to get a list of IP addresses and port
X+numbers for host hostname and service servname.  
X .Sh ENVIRONMENT
X .Bl -tag -width HOSTALIASES
X .It HOSTALIASES
END-of-libdnsres/files/patch-dnsres.3
echo x - libdnsres/files/patch-test-simple_test.c
sed 's/^X//' >libdnsres/files/patch-test-simple_test.c << 'END-of-libdnsres/files/patch-test-simple_test.c'
X--- test/simple_test.c.old	Fri Feb  3 19:18:27 2006
X+++ test/simple_test.c	Fri Feb  3 19:18:48 2006
X@@ -47,7 +47,7 @@
X #include <unistd.h>
X #include <ctype.h>
X #include <fcntl.h>
X-
X+#include <sys/time.h>
X #include <event.h>
X 
X #include "dnsres.h"
END-of-libdnsres/files/patch-test-simple_test.c
exit
--- libdnsres.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602142330.k1ENULwf077984>