Commit e5079516 authored by David Anders's avatar David Anders
Browse files

add new package bind per case 0000507

parent 9f9e0202
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ source "package/at/Config.in"
source "package/autoconf/Config.in"
source "package/automake/Config.in"
source "package/berkeleydb/Config.in"
source "package/bind/Config.in"
source "package/bison/Config.in"
source "package/boa/Config.in"
source "package/bridge/Config.in"

package/bind/Config.in

0 → 100644
+22 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_BIND
	bool "bind"
	default n
	help
	  BIND (Berkeley Internet Name Domain) is an implementation of
	  the Domain Name System (DNS) protocols and provides an openly
	  redistributable reference implementation of the major
	  components of the Domain Name System, including:

	    * a Domain Name System server (named)
	    * a Domain Name System resolver library
	    * tools for verifying the proper operation of the DNS server 

	  The BIND DNS Server is used on the vast majority of name
	  serving machines on the Internet, providing a robust and
	  stable architecture on top of which an organization's naming
	  architecture can be built. The resolver library included in
	  the BIND distribution provides the standard APIs for
	  translation between domain names and Internet addresses and is
	  intended to be linked with applications requiring name service. 

	  http://www.isc.org/sw/bind/
+43 −0
Original line number Diff line number Diff line
diff -Naur bind-9.3.1/configure bind/configure
--- bind-9.3.1/configure	2004-12-08 20:09:03.000000000 -0800
+++ bind/configure	2005-09-09 16:06:50.000000000 -0700
@@ -23678,11 +23678,9 @@
 echo "$as_me:$LINENO: checking for inet_ntop with IPv6 support" >&5
 echo $ECHO_N "checking for inet_ntop with IPv6 support... $ECHO_C" >&6
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  echo "$as_me:$LINENO: result: assuming target platform has working inet_ntop" >&5
+echo "${ECHO_T}assuming target platform has working inet_ntop" >&6
+	ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
diff -Naur bind-9.3.1/configure.in bind/configure.in
--- bind-9.3.1/configure.in	2004-12-08 20:07:10.000000000 -0800
+++ bind/configure.in	2005-09-09 16:06:39.000000000 -0700
@@ -1414,7 +1414,9 @@
         [AC_MSG_RESULT(no)
         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
-        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
+        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
+        [AC_MSG_RESULT(assuming target platform has working inet_ntop)
+        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
 
 
 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
--- bind-9.3.1/lib/dns/Makefile.in	2005-09-09 16:21:34.000000000 -0700
+++ bind/lib/dns/Makefile.in	2005-09-09 16:28:16.000000000 -0700
@@ -156,7 +156,7 @@
 	./gen -s ${srcdir} > code.h
 
 gen: gen.c
-	${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
+	cc ${ALL_CFLAGS} -o $@ ${srcdir}/gen.c
 
 rbtdb64.@O@: rbtdb.c
 
+89 −0
Original line number Diff line number Diff line
--- bind-9.3.1/bin/named/Makefile.in	2004-09-06 14:47:25.000000000 -0700
+++ bind/bin/named/Makefile.in	2005-09-19 15:55:17.000000000 -0700
@@ -29,7 +29,7 @@
 DBDRIVER_OBJS =
 DBDRIVER_SRCS =
 DBDRIVER_INCLUDES =
-DBDRIVER_LIBS =
+DBDRIVER_LIBS = -ldl
 
 CINCLUDES =	-I${srcdir}/include -I${srcdir}/unix/include \
 		${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
diff -aur bind-9.3.1/bin/named/main.c bind/bin/named/main.c
--- bind-9.3.1/bin/named/main.c	2004-10-24 17:42:54.000000000 -0700
+++ bind/bin/named/main.c	2005-09-14 10:49:28.000000000 -0700
@@ -22,6 +22,7 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <dlfcn.h>
 
 #include <isc/app.h>
 #include <isc/commandline.h>
@@ -540,6 +541,7 @@
 static void
 setup(void) {
 	isc_result_t result;
+	void        *handle;
 
 	/*
 	 * Get the user and group information before changing the root
@@ -655,13 +657,33 @@
 	/*
 	 * Add calls to register sdb drivers here.
 	 */
-	/* xxdb_init(); */
-
+	handle = dlopen ("cadb.so", RTLD_NOW);
+	if (!handle) {
+	    fprintf (stderr, "failed to load cadb driver: %s\n", dlerror());
+	} else {
+	    isc_result_t (*cadbinit)(void);
+	    const char *error;
+	    
+	    dlerror();    /* Clear any existing error */
+	    *(void **) (&cadbinit) = dlsym(handle, "cadb_init");
+	    if ((error = dlerror()) != NULL)  {
+		fprintf (stderr, "failing loading cadbinit symbol: %s\n", error);
+		exit(1);
+	    }
+	   
+	    if((*cadbinit)() != ISC_R_SUCCESS) {
+		fprintf (stderr, "cadbinit failed");
+		exit(1);
+	    }
+	}
+	
 	ns_server_create(ns_g_mctx, &ns_g_server);
 }
 
 static void
 cleanup(void) {
+	void *handle;
+
 	destroy_managers();
 
 	ns_server_destroy(&ns_g_server);
@@ -671,7 +693,21 @@
 	/*
 	 * Add calls to unregister sdb drivers here.
 	 */
-	/* xxdb_clear(); */
+	handle = dlopen ("cadb.so", RTLD_NOW);
+	if (!handle) {
+	    fprintf (stderr, "failed to load cadb driver: %s\n", dlerror());
+	} else {
+	    isc_result_t (*cadbclear)(void);
+	    const char *error;
+	    
+	    dlerror();    /* Clear any existing error */
+	    *(void **) (&cadbclear) = dlsym(handle, "cadb_clear");
+	    if ((error = dlerror()) != NULL)  {
+		fprintf (stderr, "failing loading cadbclear symbol: %s\n", error);
+	    } else {
+	        (*cadbclear)();
+	    }
+	}
 
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
 		      ISC_LOG_NOTICE, "exiting");

package/bind/bind.mk

0 → 100644
+101 −0
Original line number Diff line number Diff line
#############################################################
#
# bind
#
#############################################################
BIND_VER:=9.3.1
BIND_SOURCE:=bind-$(BIND_VER).tar.gz
BIND_SITE:=ftp://ftp.isc.org/isc/bind9/$(BIND_VER)
BIND_DIR1:=$(TOOL_BUILD_DIR)/bind-$(BIND_VER)
BIND_DIR2:=$(BUILD_DIR)/bind-$(BIND_VER)
BIND_CAT:=zcat
BIND_BINARY:=bin/named/named
BIND_TARGET_BINARY:=usr/sbin/named

$(DL_DIR)/$(BIND_SOURCE):
	 $(WGET) -P $(DL_DIR) $(BIND_SITE)/$(BIND_SOURCE)

bind-source: $(DL_DIR)/$(BIND_SOURCE)

#############################################################
#
# build bind for use on the target system
#
#############################################################
$(BIND_DIR2)/.unpacked: $(DL_DIR)/$(BIND_SOURCE)
	$(BIND_CAT) $(DL_DIR)/$(BIND_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(BIND_DIR2) package/bind/ bind\*.patch
	touch  $(BIND_DIR2)/.unpacked

$(BIND_DIR2)/Makefile: $(BIND_DIR2)/.unpacked
	(cd $(BIND_DIR2); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--libdir=/lib \
		--includedir=/include \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--without-openssl \
		--with-randomdev=/dev/random \
		--enable-ipv6 \
		--disable-static \
		--with-libtool \
	);

$(BIND_DIR2)/$(BIND_BINARY): $(BIND_DIR2)/Makefile
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -j1 -C $(BIND_DIR2)
	touch -c $(BIND_DIR2)/$(BIND_BINARY)

#############################################################
#
# install bind binaries
#
#############################################################
$(TARGET_DIR)/$(BIND_TARGET_BINARY): $(BIND_DIR2)/$(BIND_BINARY)
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -j1 MAKEDEFS="INSTALL_DATA=true" \
		DESTDIR=$(TARGET_DIR) -C $(BIND_DIR2)/bin install
	cd $(TARGET_DIR)/usr/man; rmdir --ignore-fail-on-non-empty man8 man5 `pwd`
	$(INSTALL) -m 0755 -D package/bind/bind.sysvinit $(TARGET_DIR)/etc/init.d/S81named

bind-bin: $(TARGET_DIR)/$(BIND_TARGET_BINARY) bind-lib

#############################################################
#
# install bind libraries
#
#############################################################
$(STAGING_DIR)/lib/libdns.so: $(BIND_DIR2)/$(BIND_BINARY)
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -j1 DESTDIR=$(STAGING_DIR) -C $(BIND_DIR2)/lib install

$(TARGET_DIR)/usr/lib/libdns.so: $(STAGING_DIR)/lib/libdns.so
	mkdir -p $(TARGET_DIR)/usr/lib
	cd $(STAGING_DIR)/lib; \
	    cp -a libdns.* libisc.* libisccc.* libbind9.* liblwres.* libisccfg.* \
		$(TARGET_DIR)/usr/lib
					
bind-lib: $(STAGING_DIR)/lib/libdns.so $(TARGET_DIR)/usr/lib/libdns.so
				      
bind: uclibc bind-bin bind-lib

bind-clean:
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BIND_DIR2) uninstall
	-$(MAKE) -C $(BIND_DIR2) clean

bind-dirclean:
	rm -rf $(BIND_DIR2)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_BIND)),y)
TARGETS+=bind
endif
Loading