# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortGroup compiler_blacklist_versions 1.0
maintainers {snc @nerdling}
description Validating, recursive, and caching DNS resolver.
homepage http://unbound.net/
depends_lib path:lib/libssl.dylib:openssl port:expat
long_description Unbound is a validating, recursive, and caching DNS \
server software product from NLnet Labs, VeriSign Inc.,\
Nominet, and Kirei. It is distributed free of charge \
in open source form under the BSD license.\
Unbound is designed as a set of modular components \
that incorporate modern features, such as enhanced \
security (DNSSEC) validation, Internet Protocol \
Version 6 (IPv6), and a client resolver library API \
as an integral part of the architecture.
master_sites http://unbound.net/downloads/
checksums rmd160 abc59d2b8b52bab5784fe56ccb8b7ed10e8830fe \
sha256 94dd9071fb13d8ccd122a3ac67c4524a3324d0e771fc7a8a7c49af8abfb926a2
configure.args-append --with-pidfile=${prefix}/var/run/${name}/${name}.pid \
--with-rootkey-file=${prefix}/etc/${name}/root.key
compiler.blacklist *llvm-gcc-4.2 *gcc-4.0 gcc-3.3 clang
variant libevent description {Build with libevent (slower, but allows use of large outgoing port ranges)} {
depends_lib-append port:libevent
configure.args-append --with-libevent=${prefix}
add_users ${unbounduser} group=${unboundgroup} home=/dev/null realname=Unbound\ Resolver
xinstall -o ${unbounduser} -g ${unboundgroup} -m 755 -d ${destroot}${prefix}/var/run/${name}
move ${destroot}${prefix}/etc/${name}/${name}.conf ${destroot}${prefix}/etc/${name}/${name}.conf-dist
reinplace -W ${destroot}${prefix}/etc/${name} "s/# auto-trust-anchor-file:/auto-trust-anchor-file:/g" ${name}.conf-dist
touch ${destroot}${prefix}/var/run/${name}/${name}.pid
file attributes ${destroot}${prefix}/var/run/${name}/${name}.pid -owner ${unbounduser} -group ${unboundgroup}
file attributes ${destroot}${prefix}/etc/${name} -group ${unboundgroup} -permissions 0775
system "${prefix}/sbin/unbound-anchor -a \"${prefix}/etc/${name}/root.key\" || :"
file attributes ${prefix}/etc/${name}/root.key -owner ${unbounduser} -group ${unboundgroup}