[buildout]
extends =
  ../autoconf/buildout.cfg
  ../automake/buildout.cfg
  ../boost-lib/buildout.cfg
  ../libtool/buildout.cfg
  ../make/buildout.cfg
  ../openssl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../zlib/buildout.cfg

# For geoip backend
# https://doc.powerdns.com/authoritative/backends/geoip.html
  ../geoip2/buildout.cfg
  ../yaml-cpp/buildout.cfg

parts =
  powerdns

[powerdns]
recipe = slapos.recipe.cmmi
url = http://downloads.powerdns.com/releases/pdns-4.2.1.tar.bz2
md5sum = b5f3998a3bc438b905c72c0473408839
configure-options =
  --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
  --with-boost=${boost-lib:location}
  --with-libcrypto=${openssl:location}
  --with-modules="geoip"
  --with-dynmodules=""
  --without-lua
  --disable-lua-records
pkg_config_depends = ${yaml-cpp:location}/lib/pkgconfig
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${libmaxminddb:location}/bin:${libtool:location}/bin:${make:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  LDFLAGS=-L${boost-lib:location}/lib -Wl,-rpath=${boost-lib:location}/lib -L${libmaxminddb:location}/lib -Wl,-rpath=${libmaxminddb:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${yaml-cpp:location}/lib -Wl,-rpath=${yaml-cpp:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
  CPPFLAGS=-I${boost-lib:location}/include -I${libmaxminddb:location}/include -I${yaml-cpp:location}/include
  PKG_CONFIG_PATH=${:pkg_config_depends}
# XXX: Override the default value "-Llib -lyaml-cpp"; "-Llib" is a problem
  YAML_LIBS = -lyaml-cpp
make-options =
  LIBTOOL=libtool
make-target =
  install
