Nov 202014
 

Quick reminder how to recompile Bind9 with MySQL SDB:

  • Prepare build environment
apt-get install build-essential fakeroot dpkg-dev devscripts
cd /usr/src/
apt-get build-dep bind9
  • Get source
apt-get source bind9/wheezy
  • Copy SDB files into place

mysql-bind$: cp mysqldb.h ../bind9-9.8.4.dfsg.P1/bin/named/include/
mysql-bind$: cp mysqldb.c ../bind9-9.8.4.dfsg.P1/bin/named/

  • Configure (read instructions from the web-page), quick diffs below
bind9-9.8.4.dfsg.P1/bin/named/main.c:
...
#include <dlz/dlz_dlopen_driver.h>
+#include <named/mysqldb.h>
...
+ mysqldb_init();
+
ns_server_create(ns_g_mctx, &ns_g_server);
...
ns_server_destroy(&ns_g_server);

+ mysqldb_clear();
+
ns_builtin_deinit();
...
bind9-9.8.4.dfsg.P1/bin/named/Makefile.in:
...
-DBDRIVER_OBJS =
-DBDRIVER_SRCS =
-DBDRIVER_INCLUDES =
-DBDRIVER_LIBS =
+DBDRIVER_OBJS = mysqldb.@O@
+DBDRIVER_SRCS = mysqldb.c
+DBDRIVER_INCLUDES = -I/usr/include/mysql -fno-omit-frame-pointer -g -pipe -Wno-uninitialized -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing
+DBDRIVER_LIBS = -L/usr/lib -lmysqlclient
...
  • Update changelog (dch) and rebuild package (debuild -us -uc)