---
name: curvedns
version: 0.88.b_2
origin: dns/curvedns
comment: Forwarder adding DNSCurve to an authoritative nameserver
arch: freebsd:9:x86:64
www: http://curvedns.on2it.net/
maintainer: freebsd@dns-lab.com
prefix: /usr/local
licenselogic: single
flatsize: 122685
desc: |
  CurveDNS is a forwarding nameserver adding DNSCurve to DNS,
  and it's the first publicly released forwarding implementation
  that implements the DNSCurve protocol.

  WWW:    http://curvedns.on2it.net/
deps:
  daemontools: {origin: sysutils/daemontools, version: 0.76_16}
  pkgconf: {origin: devel/pkgconf, version: 0.9.2_1}
  libev: {origin: devel/libev, version: '4.15,1'}
categories:
- dns
users:
- bind
groups:
- bind
shlibs_required:
- libev.so.4
files:
  /usr/local/bin/curvedns: b78e1275da6a375f05ea74ad0acaeaf5c0c2ba30829cb06de322e6ae8429c209
  /usr/local/bin/curvedns-keygen: 09c08b480980d763276dee6c523ab8c57564ea17280a31e7e9247709d28b41fa
  /usr/local/etc/curvedns/env/GID: 877a8799041017f1719854e4e295c6dca56cd1cf1b1914d1bfed9281f7fc2686
  /usr/local/etc/curvedns/env/UID: 877a8799041017f1719854e4e295c6dca56cd1cf1b1914d1bfed9281f7fc2686
  /usr/local/etc/curvedns/log/run.sample: 087fa89fde394e7cdc5e18d38a33355754579cfd436bfe6db83a91fabee7dccf
  /usr/local/etc/curvedns/run.sample: b09671cf364a2bfaa946fb1e0e06c2d3e77f843d655c5c8b409d424cf0eb79ce
directories:
  /usr/local/etc/curvedns/log/: y
  /usr/local/etc/curvedns/env/: y
  /usr/local/etc/curvedns/: y
scripts:
  post-install: |
    echo "===> Creating users and/or groups."
    if ! /usr/sbin/pw groupshow bind >/dev/null 2>&1; then  echo "Creating group 'bind' with gid '53'.";  /usr/sbin/pw groupadd bind -g 53; else echo "Using existing group 'bind'."; fi
    if ! /usr/sbin/pw usershow bind >/dev/null 2>&1; then  echo "Creating user 'bind' with uid '53'.";  /usr/sbin/pw useradd bind -u 53 -g 53  -c "Bind Sandbox" -d / -s /usr/sbin/nologin;  else echo "Using existing user 'bind'."; fi
    install -d -g 53 -o 53 /
    [ -f etc/curvedns/run ] || cp -p etc/curvedns/run.sample etc/curvedns/run
    [ -f etc/curvedns/log/run ] || cp -p etc/curvedns/log/run.sample etc/curvedns/log/run
  pre-deinstall: |
    cmp -s /usr/local/etc/curvedns/env/etc/curvedns/env/GID /usr/local/etc/curvedns/env/run && rm -f /usr/local/etc/curvedns/env/run || true
    cmp -s /usr/local/etc/curvedns/etc/curvedns/run.sample /usr/local/etc/curvedns/run && rm -f /usr/local/etc/curvedns/run || true
message: |
  ###########################################################

   To start using curvedns, finish the following tasks:

  ------- generate/install keys -----------------------------

   curvedns-keygen /usr/local/etc/curvedns ns.example.net

  ------- configure -----------------------------------------

   $EDITOR /usr/local/etc/curvedns/run.sample
   # set user from "curvedns" to "bind" (required!),
   # adjust IP / port-numbers,
   # and save as /usr/local/etc/curvedns/run

   $EDITOR /usr/local/etc/curvedns/log/run.sample
   # set user from "curvedns" to "bind" (required!),
   # and save as /usr/local/etc/curvedns/log/run

  ------- prepare/startup -----------------------------------

   mkdir /var/service
   ln -s /usr/local/etc/curvedns /var/service
   echo svscan_enable=\"YES\" >> /etc/rc.conf
   /usr/local/etc/rc.d/svscan start

  ------- verify --------------------------------------------

   # examples:
   dig @<curvedns-ip> auth-dom.example any
   drill <curvedns-ip> auth-dom.example any

  ###########################################################
