Adam Tkac 86c080
diff -up bind-9.8.1rc1/bin/named-sdb/main.c.sdb-sqlite-bld bind-9.8.1rc1/bin/named-sdb/main.c
Adam Tkac 86c080
--- bind-9.8.1rc1/bin/named-sdb/main.c.sdb-sqlite-bld	2011-08-31 14:41:15.646020840 +0200
Adam Tkac 86c080
+++ bind-9.8.1rc1/bin/named-sdb/main.c	2011-08-31 14:41:35.132019452 +0200
Adam Tkac 86c080
@@ -85,6 +85,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 86c080
 #ifdef CONTRIB_DLZ
Adam Tkac 86c080
@@ -792,6 +793,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 86c080
@@ -921,6 +923,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 86c080
@@ -971,6 +990,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 86c080
diff -up bind-9.8.1rc1/bin/named-sdb/Makefile.in.sdb-sqlite-bld bind-9.8.1rc1/bin/named-sdb/Makefile.in
Adam Tkac 86c080
--- bind-9.8.1rc1/bin/named-sdb/Makefile.in.sdb-sqlite-bld	2011-08-31 14:41:15.646020840 +0200
Adam Tkac 86c080
+++ bind-9.8.1rc1/bin/named-sdb/Makefile.in	2011-08-31 14:41:15.658020839 +0200
Adam Tkac 86c080
@@ -28,10 +28,10 @@ top_srcdir =	@top_srcdir@
Adam Tkac 1e57f4
 #
Adam Tkac 1e57f4
 # Add database drivers here.
Adam Tkac 1e57f4
 #
Adam Tkac 1e57f4
-DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ dirdb.@O@
Adam Tkac 1e57f4
-DBDRIVER_SRCS =	ldapdb.c pgsqldb.c dirdb.c
Adam Tkac 1e57f4
+DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ sqlitedb.@O@ dirdb.@O@
Adam Tkac 1e57f4
+DBDRIVER_SRCS =	ldapdb.c pgsqldb.c sqlitedb.c dirdb.c
Adam Tkac 1e57f4
 DBDRIVER_INCLUDES =
Adam Tkac 1e57f4
-DBDRIVER_LIBS =	-lldap -llber -lpq
Adam Tkac 1e57f4
+DBDRIVER_LIBS =	-lldap -llber -lpq -lsqlite3
Adam Tkac 1e57f4
 
Adam Tkac 1e57f4
 DLZ_DRIVER_DIR =	${top_srcdir}/contrib/dlz/drivers
Adam Tkac 1e57f4
 
Adam Tkac 86c080
diff -up bind-9.8.1rc1/bin/sdb_tools/Makefile.in.sdb-sqlite-bld bind-9.8.1rc1/bin/sdb_tools/Makefile.in
Adam Tkac 86c080
--- bind-9.8.1rc1/bin/sdb_tools/Makefile.in.sdb-sqlite-bld	2011-08-31 14:41:15.651020840 +0200
Adam Tkac 86c080
+++ bind-9.8.1rc1/bin/sdb_tools/Makefile.in	2011-08-31 14:41:15.658020839 +0200
Adam Tkac 86c080
@@ -32,11 +32,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 86c080
@@ -50,6 +50,9 @@ zone2ldap@EXEEXT@: zone2ldap.@O@ ${DEPLI
Adam Tkac 1e57f4
 zonetodb@EXEEXT@: zonetodb.@O@  ${DEPLIBS}
Adam Tkac 1e57f4
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS}
Adam Tkac c30533
 
Adam Tkac 1e57f4
+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 1e57f4
 ldap2zone@EXEEXT@: ldap2zone.@O@ ${DEPLIBS}
Adam Tkac 1e57f4
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ldap2zone.@O@ -lldap -llber ${LIBS}
Adam Tkac c30533
 
Adam Tkac 86c080
@@ -64,4 +67,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