diff -Naur '--exclude=.*' make/mDNSResponder.orig/Config.in make/mDNSResponder/Config.in
--- make/mDNSResponder.orig/Config.in 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/Config.in 2012-04-15 11:51:09.000000000 +0200
@@ -0,0 +1,10 @@
+config FREETZ_PACKAGE_MDNSRESPONDER
+ bool "mDNSResponder 320.5 (binaries only)"
+ default n
+ help
+ The mDNSResponder project is a component of Bonjour,
+ Apple's ease-of-use IP networking initiative:
+ <http://developer.apple.com/bonjour/>
+ Apple's Bonjour software derives from the ongoing standardization
+ work of the IETF Zero Configuration Networking Working Group:
+ <http://zeroconf.org/>
diff -Naur '--exclude=.*' make/mDNSResponder.orig/external.files make/mDNSResponder/external.files
--- make/mDNSResponder.orig/external.files 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/external.files 2012-04-15 11:54:34.000000000 +0200
@@ -0,0 +1 @@
+[ "$EXTERNAL_FREETZ_PACKAGE_MDNSRESPONDER" == "y" ] && EXTERNAL_FILES+=" /usr/bin/mDNSResponderPosix"
diff -Naur '--exclude=.*' make/mDNSResponder.orig/external.in make/mDNSResponder/external.in
--- make/mDNSResponder.orig/external.in 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/external.in 2012-04-15 11:55:08.000000000 +0200
@@ -0,0 +1,7 @@
+config EXTERNAL_FREETZ_PACKAGE_MDNSRESPONDER
+ depends on EXTERNAL_ENABLED && FREETZ_PACKAGE_MDNSRESPONDER
+ bool "mdnsresponder"
+ default n
+ help
+ externals these file(s):
+ /usr/bin/mDNSResponderPosix
diff -Naur '--exclude=.*' make/mDNSResponder.orig/Makefile.in make/mDNSResponder/Makefile.in
--- make/mDNSResponder.orig/Makefile.in 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/Makefile.in 2012-04-15 11:51:52.000000000 +0200
@@ -0,0 +1,3 @@
+ifeq ($(strip $(FREETZ_PACKAGE_MDNSRESPONDER)),y)
+PACKAGES+=mdnsresponder
+endif
diff -Naur '--exclude=.*' make/mDNSResponder.orig/mDNSResponder.mk make/mDNSResponder/mDNSResponder.mk
--- make/mDNSResponder.orig/mDNSResponder.mk 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/mDNSResponder.mk 2012-04-15 11:43:53.000000000 +0200
@@ -0,0 +1,33 @@
+$(call PKG_INIT_BIN, 320.5)
+$(PKG)_SOURCE:=$(pkg)-$($(PKG)_VERSION).tar.gz
+$(PKG)_SOURCE_MD5:=34a4bf65917ea67a923d3c8c1ad80606
+$(PKG)_SITE:=http://www.opensource.apple.com/tarballs/$(pkg)
+$(PKG)_BINARIES:=$(pkg)Posix
+$(PKG)_BINARIES_BUILD_DIR:=$($(PKG)_BINARIES:%=$($(PKG)_DIR)/mDNSPosix/build/prod/%)
+$(PKG)_BINARIES_TARGET_DIR:=$($(PKG)_BINARIES:%=$($(PKG)_DEST_DIR)/usr/bin/%)
+
+$(PKG_SOURCE_DOWNLOAD)
+$(PKG_UNPACKED)
+$(PKG_CONFIGURED_NOP)
+
+$($(PKG)_BINARIES_BUILD_DIR): $($(PKG)_DIR)/.configured
+ $(SUBMAKE1) -C $(MDNSRESPONDER_DIR)/mDNSPosix \
+ CC="$(TARGET_CC)" \
+ CFLAGS_F="$(TARGET_CFLAGS)" \
+ LD="$(TARGET_LD) -shared"
+
+$($(PKG)_BINARIES_TARGET_DIR): $($(PKG)_DEST_DIR)/usr/bin/%: $($(PKG)_DIR)/mDNSPosix/build/prod/%
+ $(INSTALL_BINARY_STRIP)
+
+$(pkg):
+
+$(pkg)-precompiled: $($(PKG)_BINARIES_TARGET_DIR)
+
+$(pkg)-clean:
+ -$(SUBMAKE1) -C $(MDNSRESPONDER_DIR) clean
+ $(RM) $(MDNSRESPONDER_DIR)/.configured
+
+$(pkg)-uninstall:
+ $(RM) $(MDNSRESPONDER_BINARIES_TARGET_DIR)
+
+$(PKG_FINISH)
diff -Naur '--exclude=.*' make/mDNSResponder.orig/patches/100_dns-sd_c.patch make/mDNSResponder/patches/100_dns-sd_c.patch
--- make/mDNSResponder.orig/patches/100_dns-sd_c.patch 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/patches/100_dns-sd_c.patch 2012-04-15 09:31:18.000000000 +0200
@@ -0,0 +1,15 @@
+--- Clients/dns-sd.c.orig 2012-04-15 09:30:03.000000000 +0200
++++ Clients/dns-sd.c 2012-04-15 02:15:01.000000000 +0200
+@@ -948,10 +948,10 @@
+ struct addrinfo *addrs = NULL;
+ int err = getaddrinfo(name, NULL, NULL, &addrs);
+ if (err) fprintf(stderr, "getaddrinfo error %d for %s", err, name);
+- else memcpy(result, addrs->ai_addr, SA_LEN(addrs->ai_addr));
++ else memcpy(result, addrs->ai_addr, sizeof(*addrs));
+ if (addrs) freeaddrinfo(addrs);
+ }
+-
++// memcpy(result, addrs->ai_addr, SA_LEN(addrs->ai_addr));
+ static DNSServiceErrorType RegisterProxyAddressRecord(DNSServiceRef sdref, const char *host, const char *ip, DNSServiceFlags flags)
+ {
+ // Call getip() after the call DNSServiceCreateConnection().
diff -Naur '--exclude=.*' make/mDNSResponder.orig/patches/110_make_people_happy_.patch make/mDNSResponder/patches/110_make_people_happy_.patch
--- make/mDNSResponder.orig/patches/110_make_people_happy_.patch 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/patches/110_make_people_happy_.patch 2012-04-15 09:26:53.000000000 +0200
@@ -0,0 +1,103 @@
+--- mDNSPosix/Makefile.orig 2012-04-15 01:23:10.000000000 +0200
++++ mDNSPosix/Makefile 2012-04-15 09:26:00.000000000 +0200
+@@ -54,7 +54,8 @@
+ SHAREDDIR ?= ../mDNSShared
+ JDK = /usr/jdk
+
+-CC = @cc
++CC =
++CFLAGS_F =
+ BISON = @bison
+ FLEX = @flex
+ LD = ld -shared
+@@ -86,78 +87,14 @@
+ endif
+
+ # Configure per-OS peculiarities
+-ifeq ($(os),solaris)
+-CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
+-CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
+- -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS
+-CC = gcc
+-LD = gcc -shared
+-LINKOPTS = -lsocket -lnsl -lresolv
+-JAVACFLAGS_OS += -I$(JDK)/include/solaris
+-ifneq ($(DEBUG),1)
+-STRIP = strip
+-endif
+-else
+
+-ifeq ($(os),linux)
+ CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX
+ FLEXFLAGS_OS = -l
+-JAVACFLAGS_OS += -I$(JDK)/include/linux
++#JAVACFLAGS_OS += -I$(JDK)/include/linux
+ OPTIONALTARG = nss_mdns
+ OPTINSTALL = InstalledNSS
+-else
+-
+-ifeq ($(os),netbsd)
+-CFLAGS_OS =
+-LDCONFIG = ldconfig
+-else
+-
+-ifeq ($(os),freebsd)
+-# If not already defined, set LOCALBASE to /usr/local
+-# FreeBSD requires the startup script to end in ".sh"
+-LOCALBASE?=/usr/local
+-INSTBASE=$(LOCALBASE)
+-STARTUPSCRIPTNAME=mdns.sh
+-CFLAGS_OS =
+-# FreeBSD 4 requires threaded code to be compiled and linked using the "-pthread" option,
+-# and requires that the "-lpthread" link option NOT be used
+-# This appies only to FreeBSD -- "man cc" on FreeBSD says:
+-# FreeBSD SPECIFIC OPTIONS
+-# -pthread
+-# Link a user-threaded process against libc_r instead of libc.
+-CFLAGS_PTHREAD = -pthread -D_THREAD_SAFE
+-LINKOPTS_PTHREAD = -pthread
+-JAVACFLAGS_OS += -I$(JDK)/include/freebsd
+-LDCONFIG = ldconfig
+-else
+-
+-ifeq ($(os),openbsd)
+-CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
+-LDCONFIG = ldconfig
+-else
+-
+-ifeq ($(os),x)
+-# We have to define __MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 or on Leopard
+-# we get build failures: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:283)
+-CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \
+- -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 #-Wunreachable-code
+-CC = gcc
+-LD = $(CC) -dynamiclib
+-LINKOPTS = -lSystem
+-LDSUFFIX = dylib
+-JDK = /System/Library/Frameworks/JavaVM.framework/Home
+-JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
+-else
+-
+-$(error ERROR: Must specify target OS on command-line, e.g. "make os=x [target]".\
+-Supported operating systems include: x, linux, netbsd, freebsd, openbsd, solaris)
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-
++#
++#
+ NSSLIBNAME := libnss_mdns
+ NSSVERSION := 0.2
+ NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so
+@@ -205,7 +142,7 @@
+ endif
+ endif
+
+-CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
++CFLAGS = $(CFLAGS_F) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
+
+ #############################################################################
+
diff -Naur '--exclude=.*' make/mDNSResponder.orig/patches/120_makefile_clients.patch make/mDNSResponder/patches/120_makefile_clients.patch
--- make/mDNSResponder.orig/patches/120_makefile_clients.patch 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/patches/120_makefile_clients.patch 2012-04-15 11:06:49.000000000 +0200
@@ -0,0 +1,39 @@
+--- Clients/Makefile.orig 2012-04-15 10:15:01.000000000 +0200
++++ Clients/Makefile 2012-04-15 11:05:40.000000000 +0200
+@@ -25,13 +25,17 @@
+
+ # On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable
+ # If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library
+-ifneq "$(wildcard /usr/lib/libSystem.dylib)" ""
+-TARGETS = build/dns-sd build/dns-sd64
+-LIBS =
+-else
++
++CC =
++CFLAGS_F =
++
++#ifneq "$(wildcard /usr/lib/libSystem.dylib)" ""
++#TARGETS = build/dns-sd build/dns-sd64
++#LIBS =
++#else
+ TARGETS = build/dns-sd
+ LIBS = -L../mDNSPosix/build/prod/ -ldns_sd
+-endif
++#endif
+
+ all: $(TARGETS)
+
+@@ -42,10 +46,10 @@
+ mkdir build
+
+ build/dns-sd: build dns-sd.c ClientCommon.c
+- cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
++ $(CC) $(CFLAGS_F) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
+
+-build/dns-sd64: build dns-sd.c ClientCommon.c
+- cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
++#build/dns-sd64: build dns-sd.c ClientCommon.c
++# cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
+
+ # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
+ # don't, because we don't want or need a 'fat' version of dns-sd, because it will
diff -Naur '--exclude=.*' make/mDNSResponder.orig/patches/130_nss_h.patch make/mDNSResponder/patches/130_nss_h.patch
--- make/mDNSResponder.orig/patches/130_nss_h.patch 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/patches/130_nss_h.patch 2012-04-15 11:33:46.000000000 +0200
@@ -0,0 +1,67 @@
+--- mDNSPosix/nss.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ mDNSPosix/nss.h 2012-04-15 11:31:52.000000000 +0200
+@@ -0,0 +1,64 @@
++/* Copyright (C) 1996, 1997, 1999, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library 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.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* Define interface to NSS. This is meant for the interface functions
++ and for implementors of new services. */
++
++#ifndef _NSS_H
++#define _NSS_H 1
++
++#include <features.h>
++#include <stdint.h>
++
++
++__BEGIN_DECLS
++
++/* Possible results of lookup using a nss_* function. */
++enum nss_status
++{
++ NSS_STATUS_TRYAGAIN = -2,
++ NSS_STATUS_UNAVAIL,
++ NSS_STATUS_NOTFOUND,
++ NSS_STATUS_SUCCESS,
++ NSS_STATUS_RETURN
++};
++
++
++/* Data structure used for the 'gethostbyname4_r' function. */
++struct gaih_addrtuple
++ {
++ struct gaih_addrtuple *next;
++ char *name;
++ int family;
++ uint32_t addr[4];
++ uint32_t scopeid;
++ };
++
++
++/* Overwrite service selection for database DBNAME using specification
++ in STRING.
++ This function should only be used by system programs which have to
++ work around non-existing services (e.e., while booting).
++ Attention: Using this function repeatedly will slowly eat up the
++ whole memory since previous selection data cannot be freed. */
++extern int __nss_configure_lookup (__const char *__dbname,
++ __const char *__string) __THROW;
++
++__END_DECLS
++
++#endif /* nss.h */
diff -Naur '--exclude=.*' make/mDNSResponder.orig/patches/140_nss_mdns_c.patch make/mDNSResponder/patches/140_nss_mdns_c.patch
--- make/mDNSResponder.orig/patches/140_nss_mdns_c.patch 1970-01-01 01:00:00.000000000 +0100
+++ make/mDNSResponder/patches/140_nss_mdns_c.patch 2012-04-15 11:42:03.000000000 +0200
@@ -0,0 +1,11 @@
+--- mDNSPosix/nss_mdns.c.orig 2012-04-15 11:35:34.000000000 +0200
++++ mDNSPosix/nss_mdns.c 2012-04-15 11:36:40.000000000 +0200
+@@ -379,7 +379,7 @@
+ #define ENTNAME hostent
+ #define DATABASE "hosts"
+
+-#include <nss.h>
++#include "nss.h"
+ // For nss_status
+ #include <netdb.h>
+ // For hostent