--- /dev/null
+usr/lib/*/pdns/liblmdbbackend.so*
--- /dev/null
+#!/bin/sh
+set -e
+
+dpkg-trigger pdns-server
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+dnl invoking this makes lmdb a requirement
+AC_DEFUN([PDNS_CHECK_LMDB], [
+ AC_MSG_CHECKING([where to find the lmdb library and headers])
+ AC_ARG_WITH([lmdb],
+ AC_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[
+ with_lmdb=$withval
+ ],[
+ with_lmdb=auto
+ ])
+ AC_MSG_RESULT([$with_lmdb])
+
+ AS_IF([test "$with_lmdb" != "no"], [
+ AS_IF([test "x$with_lmdb" = "xyes" -o "x$with_lmdb" = "xauto"], [
+ PKG_CHECK_MODULES([LMDB], [lmdb], [ : ], [
+ AC_MSG_ERROR([lmdb not found via pkg-config, please install lmdb or set --with-lmdb to your lmdb installation directory])
+ ])
+ ], [
+ save_CPPFLAGS=$CPPFLAGS
+ save_LIBS=$LIBS
+ AS_IF([test -d "$with_lmdb/include"], [
+ LMDB_CFLAGS="-I$with_lmdb/include"
+ LMDB_LIBS="-L$with_lmdb/lib"
+ ],[
+ LMDB_CFLAGS="-I$with_lmdb"
+ LMDB_LIBS="-L$with_lmdb"
+ ])
+ CPPFLAGS="$LMDB_CFLAGS"
+ LIBS="$LMDB_LIBS"
+
+ AC_SEARCH_LIBS([mdb_env_open], [lmdb], [
+ AC_CHECK_HEADERS([lmdb.h], [
+ dnl ac_cv_search_mdb_env_open contains '-llmdb'
+ LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_open"
+ ], [
+ AC_MSG_ERROR([lmdb headers not found in $with_lmdb])
+ ])
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ AC_SUBST([LMDB_CFLAGS])
+ AC_SUBST([LMDB_LIBS])
+ ])
+ ])
+ ], [
+ AC_MSG_ERROR([--with-lmdb is set to 'no', but lmdb support is required])
+ ])
+])
--- /dev/null
+case $context in
+ lmdb | lmdb-nodnssec | lmdb-nsec3 | lmdb-nsec3-optout | lmdb-nsec3-narrow)
+ cat > pdns-lmdb.conf << __EOF__
+module-dir=./modules
+launch=lmdb
+lmdb-filename=./pdns.lmdb
+__EOF__
+
+ skipreasons="$skipreasons lmdb nodyndns"
+ rm -f pdns.lmdb*
+ for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | grep -v '^nztest.com$')
+ do
+ if [ "$zone" = "." ]; then
+ $PDNSUTIL --config-dir=. --config-name=lmdb load-zone $zone zones/ROOT
+ else
+ $PDNSUTIL --config-dir=. --config-name=lmdb load-zone $zone zones/$zone
+ fi
+ if [ $context != lmdb-nodnssec ]
+ then
+ extracontexts="dnssec lmdb"
+ skipreasons="$skipreasons nodyndns"
+ if [ $context = lmdb-nsec3 ]
+ then
+ extracontexts="dnssec nsec3 lmdb"
+ $PDNSUTIL --config-dir=. --config-name=lmdb set-nsec3 $zone "1 0 1 abcd" 2>&1
+ elif [ $context = lmdb-nsec3-optout ]
+ then
+ extracontexts="dnssec nsec3 nsec3-optout lmdb"
+ skipreasons="$skipreasons optout"
+ $PDNSUTIL --config-dir=. --config-name=lmdb set-nsec3 $zone "1 1 1 abcd" 2>&1
+ elif [ $context = lmdb-nsec3-narrow ]
+ then
+ $PDNSUTIL --config-dir=. --config-name=lmdb set-nsec3 $zone '1 1 1 abcd' narrow 2>&1
+ extracontexts="dnssec narrow lmdb"
+ skipreasons="$skipreasons narrow"
+ else
+ skipreasons="$skipreasons nsec"
+ fi
+ securezone $zone lmdb
+ else
+ skipreasons="$skipreasons nodnssec nodyndns"
+ $PDNSUTIL --config-dir=. --config-name=lmdb rectify-zone $zone 2>&1
+ fi
+ if [ "$zone" = "tsig.com" ]; then
+ $PDNSUTIL --config-dir=. --config-name=lmdb import-tsig-key test $ALGORITHM $KEY
+ $PDNSUTIL --config-dir=. --config-name=lmdb activate-tsig-key tsig.com test master
+ fi
+ done
+
+ $RUNWRAPPER $PDNS --daemon=no --local-address=$address --local-port=$port --config-dir=. \
+ --config-name=lmdb --socket-dir=./ --no-shuffle \
+ --dnsupdate=no \
+ --expand-alias=yes --resolver=8.8.8.8 \
+ --disable-axfr-rectify=yes --outgoing-axfr-expand-alias=yes \
+ --cache-ttl=$cachettl --dname-processing $lua_prequery &
+
+ ;;
+ *)
+ nocontext=yes
+esac
--- /dev/null
+ context=${context}-presigned-lmdb
+ cat > pdns-lmdb2.conf << __EOF__
+module-dir=./modules
+launch=lmdb
+lmdb-filename=./pdns2.lmdb
+__EOF__
+
+ rm -f pdns2.lmdb*
+ zones=0
+ for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | grep -v '^nztest.com$' | perl -e 'print reverse <STDIN>')
+ do
+ let zones=zones+1
+ $PDNSUTIL --config-dir=. --config-name=lmdb2 create-slave-zone $zone 127.0.0.1:$port
+ if [ "$zone" = "tsig.com" ]; then
+ $PDNSUTIL --config-dir=. --config-name=lmdb2 import-tsig-key test $ALGORITHM $KEY
+ $PDNSUTIL --config-dir=. --config-name=lmdb2 activate-tsig-key tsig.com test slave
+ fi
+ if [ "$zone" = "stest.com" ]; then
+ if [[ $skipreasons != *nolua* ]]; then
+ $PDNSUTIL --config-dir=. --config-name=lmdb2 set-meta stest.com AXFR-SOURCE 127.0.0.2
+ fi
+ fi
+ done
+
+ port=$((port+100))
+
+ $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \
+ --config-name=lmdb2 --socket-dir=./ --no-shuffle \
+ --slave --retrieval-threads=4 \
+ --slave-cycle-interval=300 --dname-processing &
+
+ echo 'waiting for zones to be slaved'
+ loopcount=0
+ while [ $loopcount -lt 30 ]
+ do
+ sleep 5
+ present=$($PDNSUTIL --config-dir=. --config-name=lmdb2 list-all-zones slave | wc -l)
+ if [ $zones -eq $present ]
+ then
+ break
+ fi
+ let loopcount=loopcount+1
+ done
+ if [ $zones -ne $present ]
+ then
+ echo "AXFR FAILED" >> failed_tests
+ exit
+ fi
--- /dev/null
+../../modules/lmdbbackend/.libs/liblmdbbackend.so
\ No newline at end of file