Adam Tkac 300cfc
diff -up bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb-sqlite-bld bind-9.5.0b2/bin/named/Makefile.in
Adam Tkac 300cfc
--- bind-9.5.0b2/bin/named-sdb/Makefile.in.sdb-sqlite-bld	2008-02-11 17:44:32.000000000 +0100
Adam Tkac 300cfc
+++ bind-9.5.0b2/bin/named-sdb/Makefile.in	2008-02-11 17:46:00.000000000 +0100
Adam Tkac bbeea4
@@ -26,10 +26,10 @@ top_srcdir =	@top_srcdir@
Adam Tkac bbeea4
 #
Adam Tkac bbeea4
 # Add database drivers here.
Adam Tkac bbeea4
 #
Adam Tkac 300cfc
-DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ dirdb.@O@
Adam Tkac 300cfc
-DBDRIVER_SRCS =	ldapdb.c pgsqldb.c dirdb.c
Adam Tkac 300cfc
+DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ sqlitedb.@O@ dirdb.@O@
Adam Tkac 300cfc
+DBDRIVER_SRCS =	ldapdb.c pgsqldb.c sqlitedb.c dirdb.c
Adam Tkac bbeea4
 DBDRIVER_INCLUDES =
Adam Tkac 300cfc
-DBDRIVER_LIBS =	-lldap -llber -lpq
Adam Tkac 300cfc
+DBDRIVER_LIBS =	-lldap -llber -lpq -lsqlite3
Adam Tkac bbeea4
 
Adam Tkac bbeea4
 DLZ_DRIVER_DIR =	${top_srcdir}/contrib/dlz/drivers
Adam Tkac bbeea4
 
Adam Tkac 300cfc
diff -up bind-9.5.0b2/bin/named-sdb/main.c.sdb-sqlite-bld bind-9.5.0b2/bin/named/main-sdb.c
Adam Tkac 300cfc
--- bind-9.5.0b2/bin/named-sdb/main.c.sdb-sqlite-bld	2008-02-11 17:44:32.000000000 +0100
Adam Tkac 300cfc
+++ bind-9.5.0b2/bin/named-sdb/main.c	2008-02-11 17:44:33.000000000 +0100
Adam Tkac c30533
@@ -74,6 +74,7 @@
Adam Tkac c30533
 /* #include "xxdb.h" */
Adam Tkac c30533
 #include "ldapdb.h"
Adam Tkac c30533
 #include "pgsqldb.h"
Adam Tkac c30533
+#include "sqlitedb.h"
Adam Tkac c30533
 #include "dirdb.h"
Adam Tkac c30533
 
Adam Tkac c30533
 /*
Adam Tkac bbeea4
@@ -646,6 +647,7 @@ setup(void) {
Adam Tkac c30533
 
Adam Tkac c30533
 	ldapdb_clear();
Adam Tkac c30533
 	pgsqldb_clear();
Adam Tkac c30533
+	sqlitedb_clear();
Adam Tkac c30533
 	dirdb_clear();
Adam Tkac c30533
 
Adam Tkac c30533
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
Adam Tkac bbeea4
@@ -743,6 +745,23 @@ setup(void) {
Adam Tkac c30533
                           ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded."
Adam Tkac c30533
                          );
Adam Tkac c30533
 
Adam Tkac c30533
+        result = sqlitedb_init();
Adam Tkac c30533
+        if (result != ISC_R_SUCCESS)
Adam Tkac c30533
+        {
Adam Tkac c30533
+             isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
Adam Tkac c30533
+                          ISC_LOG_ERROR, 
Adam Tkac c30533
+                          "SDB sqlite3 module initialisation failed: %s.",
Adam Tkac c30533
+                          isc_result_totext(result)
Adam Tkac c30533
+                );
Adam Tkac c30533
+            isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
Adam Tkac c30533
+                          ISC_LOG_ERROR, 
Adam Tkac c30533
+                          "SDB sqlite3 zone database will be unavailable."
Adam Tkac c30533
+                );
Adam Tkac c30533
+        }else
Adam Tkac c30533
+            isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
Adam Tkac c30533
+                          ISC_LOG_NOTICE, "SDB sqlite3 DB zone database module loaded."
Adam Tkac c30533
+                         );
Adam Tkac c30533
+
Adam Tkac c30533
         result = dirdb_init();
Adam Tkac c30533
         if (result != ISC_R_SUCCESS)
Adam Tkac c30533
         {
Adam Tkac bbeea4
@@ -787,6 +806,7 @@ cleanup(void) {
Adam Tkac c30533
 
Adam Tkac c30533
         ldapdb_clear();
Adam Tkac c30533
         pgsqldb_clear();
Adam Tkac c30533
+        sqlitedb_clear();
Adam Tkac c30533
         dirdb_clear();
Adam Tkac c30533
 
Adam Tkac c30533
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
Adam Tkac bbeea4
diff -up bind-9.5.0b2/bin/sdb_tools/Makefile.in.sdb-sqlite-bld bind-9.5.0b2/bin/sdb_tools/Makefile.in
Adam Tkac bbeea4
--- bind-9.5.0b2/bin/sdb_tools/Makefile.in.sdb-sqlite-bld	2008-02-11 17:44:33.000000000 +0100
Adam Tkac bbeea4
+++ bind-9.5.0b2/bin/sdb_tools/Makefile.in	2008-02-11 17:44:33.000000000 +0100
Adam Tkac bbeea4
@@ -30,11 +30,11 @@ DEPLIBS =	${LWRESDEPLIBS} ${DNSDEPLIBS} 
Adam Tkac c30533
 LIBS =		${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
Adam Tkac c30533
 		${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@
Adam Tkac c30533
 
Adam Tkac c30533
-TARGETS =	zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@
Adam Tkac c30533
+TARGETS =	zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@
Adam Tkac c30533
 
Adam Tkac 5ca594
-OBJS	=	zone2ldap.@O@ ldap2zone.@O@ zonetodb.@O@
Adam Tkac 5ca594
+OBJS	=	zone2ldap.@O@ ldap2zone.@O@ zonetodb.@O@ zone2sqlite.@O@
Adam Tkac c30533
 
Adam Tkac c30533
-SRCS    =       zone2ldap.c ldap2zone.c zonetodb.c
Adam Tkac c30533
+SRCS    =       zone2ldap.c ldap2zone.c zonetodb.c zone2sqlite.c
Adam Tkac c30533
 
Adam Tkac c30533
 MANPAGES =      zone2ldap.1
Adam Tkac c30533
 
Adam Tkac bbeea4
@@ -54,6 +54,9 @@ zone2ldap:	zone2ldap.o ${DEPLIBS}
Adam Tkac 5ca594
 zonetodb@EXEEXT@:	zonetodb.@O@  ${DEPLIBS}
Adam Tkac 5ca594
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS}
Adam Tkac c30533
 
Adam Tkac 5ca594
+zone2sqlite@EXEEXT@:	zone2sqlite.@O@  ${DEPLIBS}
Adam Tkac 5ca594
+	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ zone2sqlite.@O@ -lsqlite3 -lssl ${LIBS}
Adam Tkac c30533
+
Adam Tkac 5ca594
 ldap2zone@EXEEXT@:	ldap2zone.@O@ ${DEPLIBS}
Adam Tkac 5ca594
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ldap2zone.@O@ -lldap -llber ${LIBS}
Adam Tkac c30533
 
Adam Tkac bbeea4
@@ -68,4 +71,5 @@ install:: ${TARGETS} installdirs
Adam Tkac 5ca594
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap@EXEEXT@ ${DESTDIR}${sbindir}
Adam Tkac 5ca594
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ldap2zone@EXEEXT@ ${DESTDIR}${sbindir}
Adam Tkac 5ca594
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb@EXEEXT@  ${DESTDIR}${sbindir}
Adam Tkac 5ca594
+	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2sqlite@EXEEXT@  ${DESTDIR}${sbindir}
Adam Tkac c30533
 	${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1