# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 55458 2009-08-11 05:27:11Z snc@macports.org $

PortSystem          1.0

name                unbound
version             1.3.3
categories          net
#license             BSD
maintainers         macports.org:snc \
                    macports.org:deric
description         Validating, recursive, and caching DNS resolver.
homepage            http://unbound.net/
platforms           darwin

set unbounduser     unbound
set unboundgroup    unbound

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           md5     f6b2b2c375288dfd2a03c4a36676221e \
                    sha1    4124d3b70a38d72a1ad47bf2a9e5aee9498ae439 \
                    rmd160  3d5b3e321c7b5fdb660da94bac1d2f93b16a166c

post-destroot {
    addgroup ${unboundgroup}
    set gid [existsgroup ${unboundgroup}]
    adduser ${unbounduser} shell=/sbin/nologin gid=${gid} \
        home=/dev/null \
        realname=Unbound\ Resolver
}

# Make it run on boot
startupitem.create  yes
startupitem.name    unbound
startupitem.start   ${prefix}/sbin/unbound
startupitem.stop    "/bin/kill \$(cat ${prefix}/etc/unbound/unbound.pid)"

livecheck.check     regex
livecheck.url       ${homepage}/download.html
livecheck.regex     "The latest version of unbound \\(currently (\\d+\\.\\d+(\\.\\d+))\\)"

use_parallel_build  no
