aboutsummaryrefslogtreecommitdiff
path: root/dns/nss_mdns
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2008-11-14 10:23:34 +0000
committerPav Lucistnik <pav@FreeBSD.org>2008-11-14 10:23:34 +0000
commita9d2704f224a543eac17baac56d8a1f2e9a7667c (patch)
treedafb9ebb3ea541fa9f8759b4bbe0e623fc04a934 /dns/nss_mdns
parent94e76155a379532fdf98fabb061c3a0ab67062b8 (diff)
downloadports-a9d2704f224a543eac17baac56d8a1f2e9a7667c.tar.gz
ports-a9d2704f224a543eac17baac56d8a1f2e9a7667c.zip
Notes
Diffstat (limited to 'dns/nss_mdns')
-rw-r--r--dns/nss_mdns/Makefile11
-rw-r--r--dns/nss_mdns/files/patch-src__Makefile.am16
-rw-r--r--dns/nss_mdns/files/patch-src__bsdnss.c63
-rw-r--r--dns/nss_mdns/files/patch-src__nss.c39
-rw-r--r--dns/nss_mdns/files/patch-src__nss_gethostname_select.h55
5 files changed, 159 insertions, 25 deletions
diff --git a/dns/nss_mdns/Makefile b/dns/nss_mdns/Makefile
index 51953f119feb..2884bde11c86 100644
--- a/dns/nss_mdns/Makefile
+++ b/dns/nss_mdns/Makefile
@@ -7,6 +7,7 @@
PORTNAME= nss_mdns
PORTVERSION= 0.10
+PORTREVISION= 1
CATEGORIES= dns ipv6
MASTER_SITES= http://0pointer.de/lennart/projects/nss-mdns/
DISTNAME= nss-mdns-${PORTVERSION}
@@ -32,6 +33,8 @@ CONFIGURE_ARGS+= \
--disable-legacy \
--disable-lynx
+INSTALLED_MODULES=nss_mdns nss_mdns_minimal
+
#
# libtool is used, therefore we must perform a GNU make based install,
# followed by removal of build rubble; we must create our own .so symlinks;
@@ -40,8 +43,10 @@ CONFIGURE_ARGS+= \
#
do-install:
@( cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET} )
- ( cd ${PREFIX}/lib ; ${LN} -s nss_mdns.so.1 nss_mdns.so )
- ${RM} ${PREFIX}/lib/nss_mdns.a ${PREFIX}/lib/nss_mdns.la
+.for INSTALLED_MODULE in ${INSTALLED_MODULES}
+ ( cd ${PREFIX}/lib ; ${LN} -s ${INSTALLED_MODULE}.so.1 ${INSTALLED_MODULE}.so )
+ ${RM} ${PREFIX}/lib/${INSTALLED_MODULE}.a ${PREFIX}/lib/${INSTALLED_MODULE}.la
+.endfor
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}/
${INSTALL_DATA} ${INSTALL_WRKSRC}/doc/README ${DOCSDIR}
@@ -50,7 +55,7 @@ do-install:
# TODO: Print a message about the etc directory used for mdns.allow
# being relative to ${PREFIX}.
-PLIST_FILES= lib/nss_mdns.so lib/nss_mdns.so.1
+PLIST_FILES= ${INSTALLED_MODULES:C/^/lib\//:C/$/.so/} ${INSTALLED_MODULES:C/^/lib\//:C/$/.so.1/}
PORTDOCS= README README.html
.include <bsd.port.pre.mk>
diff --git a/dns/nss_mdns/files/patch-src__Makefile.am b/dns/nss_mdns/files/patch-src__Makefile.am
index 7bbd1b6540b3..38c455707f6d 100644
--- a/dns/nss_mdns/files/patch-src__Makefile.am
+++ b/dns/nss_mdns/files/patch-src__Makefile.am
@@ -1,21 +1,19 @@
---- src/Makefile.am.orig 2007-02-08 22:12:23.000000000 +0530
-+++ src/Makefile.am 2008-04-30 02:52:50.000000000 +0530
-@@ -34,13 +34,7 @@
- lib_LTLIBRARIES =
-
+--- src/Makefile.am.orig 2007-02-08 16:42:23.000000000 +0000
++++ src/Makefile.am 2008-10-13 23:23:25.000000000 +0100
+@@ -36,11 +36,7 @@
if FREEBSD_NSS
--lib_LTLIBRARIES += \
-- nss_mdns.la \
+ lib_LTLIBRARIES += \
+ nss_mdns.la \
- nss_mdns4.la \
- nss_mdns6.la \
- nss_mdns_minimal.la \
- nss_mdns4_minimal.la \
- nss_mdns6_minimal.la
-+lib_LTLIBRARIES += nss_mdns.la
++ nss_mdns_minimal.la
else
lib_LTLIBRARIES += \
libnss_mdns.la \
-@@ -90,7 +84,7 @@
+@@ -90,7 +86,7 @@
libnss_mdns6_minimal_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
# FreeBSD
diff --git a/dns/nss_mdns/files/patch-src__bsdnss.c b/dns/nss_mdns/files/patch-src__bsdnss.c
index e95192c1d62c..6a6ca02f0215 100644
--- a/dns/nss_mdns/files/patch-src__bsdnss.c
+++ b/dns/nss_mdns/files/patch-src__bsdnss.c
@@ -1,15 +1,52 @@
---- src/bsdnss.c.orig 2008-04-30 02:40:37.000000000 +0530
-+++ src/bsdnss.c 2008-04-30 02:43:11.000000000 +0530
-@@ -56,7 +56,7 @@
- #if defined(NSS_IPV4_ONLY) || defined(NSS_IPV6_ONLY)
- /*
- * FreeBSD's libc is always built with IPv4 support.
-- * There is no way of telling at compile time with a define if libc
-+ * Therxe is no way of telling at compile time with a define if libc
- * was built with -DINET6 or not; a configure test would be required.
- * Therefore, distinguishing between the two makes no sense.
- */
-@@ -219,22 +219,8 @@
+--- src/bsdnss.c.orig 2007-02-08 16:42:23.000000000 +0000
++++ src/bsdnss.c 2008-10-07 23:38:41.000000000 +0100
+@@ -45,6 +45,7 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+
++#include "nss_gethostname_select.h"
+ #include "config.h"
+
+ #ifdef MDNS_MINIMAL
+@@ -80,37 +81,6 @@
+ ns_mtab *nss_module_register(const char *source, unsigned int *mtabsize,
+ nss_module_unregister_fn *unreg);
+
+-extern enum nss_status _nss_mdns_gethostbyname_r (const char *name, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-
+-extern enum nss_status _nss_mdns_gethostbyname2_r (const char *name, int af, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-extern enum nss_status _nss_mdns_gethostbyaddr_r (struct in_addr * addr, int len, int type,
+- struct hostent * result, char *buffer,
+- size_t buflen, int *errnop, int *h_errnop);
+-extern enum nss_status _nss_mdns4_gethostbyname_r (const char *name, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-
+-extern enum nss_status _nss_mdns4_gethostbyname2_r (const char *name, int af, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-extern enum nss_status _nss_mdns4_gethostbyaddr_r (struct in_addr * addr, int len, int type,
+- struct hostent * result, char *buffer,
+- size_t buflen, int *errnop, int *h_errnop);
+-extern enum nss_status _nss_mdns6_gethostbyname_r (const char *name, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-
+-extern enum nss_status _nss_mdns6_gethostbyname2_r (const char *name, int af, struct hostent * result,
+- char *buffer, size_t buflen, int *errnop,
+- int *h_errnop);
+-extern enum nss_status _nss_mdns6_gethostbyaddr_r (struct in_addr * addr, int len, int type,
+- struct hostent * result, char *buffer,
+- size_t buflen, int *errnop, int *h_errnop);
+-
+ typedef enum nss_status (*_bsd_nsstub_fn_t)(const char *, struct hostent *, char *, size_t, int *, int *);
+
+ /* XXX: FreeBSD 5.x is not supported. */
+@@ -219,22 +189,8 @@
* 2. Map hostent to addrinfo.
* 3. Hand-off buffer to libc.
*/
@@ -30,7 +67,7 @@
- break;
- }
+ status = _nss_mdns_gethostbyname2_r(name, pai->ai_family, hp, buffer,
-+ mbuflen, &_errno, &_h_errno);
++ mbuflen, &_errno, &_h_errno);
status = __nss_compat_result(status, _errno);
if (status == NS_SUCCESS) {
diff --git a/dns/nss_mdns/files/patch-src__nss.c b/dns/nss_mdns/files/patch-src__nss.c
new file mode 100644
index 000000000000..6739c7c0cb46
--- /dev/null
+++ b/dns/nss_mdns/files/patch-src__nss.c
@@ -0,0 +1,39 @@
+--- src/nss.c.orig 2008-10-06 23:16:19.000000000 +0100
++++ src/nss.c 2008-10-07 22:15:07.000000000 +0100
+@@ -23,6 +23,7 @@
+ #include <config.h>
+ #endif
+
++#include <netinet/in.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <string.h>
+@@ -39,27 +40,7 @@
+ #include "avahi.h"
+ #endif
+
+-#if defined(NSS_IPV4_ONLY) && ! defined(MDNS_MINIMAL)
+-#define _nss_mdns_gethostbyname2_r _nss_mdns4_gethostbyname2_r
+-#define _nss_mdns_gethostbyname_r _nss_mdns4_gethostbyname_r
+-#define _nss_mdns_gethostbyaddr_r _nss_mdns4_gethostbyaddr_r
+-#elif defined(NSS_IPV4_ONLY) && defined(MDNS_MINIMAL)
+-#define _nss_mdns_gethostbyname2_r _nss_mdns4_minimal_gethostbyname2_r
+-#define _nss_mdns_gethostbyname_r _nss_mdns4_minimal_gethostbyname_r
+-#define _nss_mdns_gethostbyaddr_r _nss_mdns4_minimal_gethostbyaddr_r
+-#elif defined(NSS_IPV6_ONLY) && ! defined(MDNS_MINIMAL)
+-#define _nss_mdns_gethostbyname2_r _nss_mdns6_gethostbyname2_r
+-#define _nss_mdns_gethostbyname_r _nss_mdns6_gethostbyname_r
+-#define _nss_mdns_gethostbyaddr_r _nss_mdns6_gethostbyaddr_r
+-#elif defined(NSS_IPV6_ONLY) && defined(MDNS_MINIMAL)
+-#define _nss_mdns_gethostbyname2_r _nss_mdns6_minimal_gethostbyname2_r
+-#define _nss_mdns_gethostbyname_r _nss_mdns6_minimal_gethostbyname_r
+-#define _nss_mdns_gethostbyaddr_r _nss_mdns6_minimal_gethostbyaddr_r
+-#elif defined(MDNS_MINIMAL)
+-#define _nss_mdns_gethostbyname2_r _nss_mdns_minimal_gethostbyname2_r
+-#define _nss_mdns_gethostbyname_r _nss_mdns_minimal_gethostbyname_r
+-#define _nss_mdns_gethostbyaddr_r _nss_mdns_minimal_gethostbyaddr_r
+-#endif
++#include "nss_gethostname_select.h"
+
+ /* Maximum number of entries to return */
+ #define MAX_ENTRIES 16
diff --git a/dns/nss_mdns/files/patch-src__nss_gethostname_select.h b/dns/nss_mdns/files/patch-src__nss_gethostname_select.h
new file mode 100644
index 000000000000..5b7b7be54788
--- /dev/null
+++ b/dns/nss_mdns/files/patch-src__nss_gethostname_select.h
@@ -0,0 +1,55 @@
+--- src/nss_gethostname_select.h.orig 2008-10-07 22:27:59.000000000 +0100
++++ src/nss_gethostname_select.h 2008-10-07 22:22:10.000000000 +0100
+@@ -0,0 +1,52 @@
++/* $Id$ */
++
++/***
++ This file is part of nss-mdns.
++
++ nss-mdns is free software; you can redistribute it and/or modify
++ it under the terms of the GNU Lesser General Public License as published
++ by the Free Software Foundation; either version 2 of the License,
++ or (at your option) any later version.
++
++ nss-mdns is distributed in the hope that it will be useful, but1
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with nss-mdns; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
++ USA.
++***/
++
++#ifndef NSS_GETHOSTNAME_SELECT_H
++#define NSS_GETHOSTNAME_SELECT_H
++
++#if defined(NSS_IPV4_ONLY) && ! defined(MDNS_MINIMAL)
++#define _nss_mdns_gethostbyname2_r _nss_mdns4_gethostbyname2_r
++#define _nss_mdns_gethostbyname_r _nss_mdns4_gethostbyname_r
++#define _nss_mdns_gethostbyaddr_r _nss_mdns4_gethostbyaddr_r
++#elif defined(NSS_IPV4_ONLY) && defined(MDNS_MINIMAL)
++#define _nss_mdns_gethostbyname2_r _nss_mdns4_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname_r _nss_mdns4_minimal_gethostbyname_r
++#define _nss_mdns_gethostbyaddr_r _nss_mdns4_minimal_gethostbyaddr_r
++#elif defined(NSS_IPV6_ONLY) && ! defined(MDNS_MINIMAL)
++#define _nss_mdns_gethostbyname2_r _nss_mdns6_gethostbyname2_r
++#define _nss_mdns_gethostbyname_r _nss_mdns6_gethostbyname_r
++#define _nss_mdns_gethostbyaddr_r _nss_mdns6_gethostbyaddr_r
++#elif defined(NSS_IPV6_ONLY) && defined(MDNS_MINIMAL)
++#define _nss_mdns_gethostbyname2_r _nss_mdns6_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname_r _nss_mdns6_minimal_gethostbyname_r
++#define _nss_mdns_gethostbyaddr_r _nss_mdns6_minimal_gethostbyaddr_r
++#elif defined(MDNS_MINIMAL)
++#define _nss_mdns_gethostbyname2_r _nss_mdns_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname_r _nss_mdns_minimal_gethostbyname_r
++#define _nss_mdns_gethostbyaddr_r _nss_mdns_minimal_gethostbyaddr_r
++#endif
++
++/* prototypes of things in nss.c */
++enum nss_status _nss_mdns_gethostbyaddr_r(const void* addr, int len, int af, struct hostent *result, char *buffer, size_t buflen, int *errnop, int *h_errnop);
++enum nss_status _nss_mdns_gethostbyname_r(const char *name, struct hostent *result, char *buffer, size_t buflen, int *errnop, int *h_errnop);
++enum nss_status _nss_mdns_gethostbyname2_r(const char *name, int af, struct hostent *result, char *buffer, size_t buflen, int *errnop, int *h_errnop);
++
++#endif