From 14622161b7d380d624df36d8ceb4d70266f1fe66 Mon Sep 17 00:00:00 2001 From: Michael Scheidell Date: Wed, 14 Mar 2012 21:41:59 +0000 Subject: [PATCH] New port: dns/knot high-performance auth-only DNS server by NIC-CZ PR: ports/165798 Submitted by: Leo Vandewoestijne Approved by: Leo Vandewoestijne (maintainer) Feature safe: yes --- dns/Makefile | 1 + dns/knot/Makefile | 49 ++++++++++++++++++++++++++++++ dns/knot/distinfo | 2 ++ dns/knot/files/knotd.in | 56 +++++++++++++++++++++++++++++++++++ dns/knot/files/pkg-message.in | 29 ++++++++++++++++++ dns/knot/pkg-descr | 20 +++++++++++++ dns/knot/pkg-plist | 16 ++++++++++ 7 files changed, 173 insertions(+) create mode 100644 dns/knot/Makefile create mode 100644 dns/knot/distinfo create mode 100644 dns/knot/files/knotd.in create mode 100644 dns/knot/files/pkg-message.in create mode 100644 dns/knot/pkg-descr create mode 100644 dns/knot/pkg-plist diff --git a/dns/Makefile b/dns/Makefile index 3d5263b2fa50..7d85c2a18e14 100644 --- a/dns/Makefile +++ b/dns/Makefile @@ -60,6 +60,7 @@ SUBDIR += idnkit2 SUBDIR += inadyn SUBDIR += ipcheck + SUBDIR += knot SUBDIR += ldapdns SUBDIR += ldns SUBDIR += ldnsm diff --git a/dns/knot/Makefile b/dns/knot/Makefile new file mode 100644 index 000000000000..14f3e99dffc0 --- /dev/null +++ b/dns/knot/Makefile @@ -0,0 +1,49 @@ +# New ports collection makefile for: knot +# Date created: 29 February 2012 +# Whom: Leo Vandewoestijne +# +# $FreeBSD$ +# + +PORTNAME= knot +PORTVERSION= 1.0.1 +CATEGORIES= dns ipv6 +MASTER_SITES= http://public.nic.cz/files/knot-dns/ \ + http://www.dns-lab.com/downloads/knot-dns/ + +MAINTAINER= freebsd@dns-lab.com +COMMENT= Knot DNS is a high performance authoritative-only DNS server + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= bison:${PORTSDIR}/devel/bison \ + flex>=2.5.35_1:${PORTSDIR}/textproc/flex +LIB_DEPENDS= urcu.1:${PORTSDIR}/sysutils/userspace-rcu + +CONFIGURE_ARGS= --sysconfdir=${ETCDIR} +GNU_CONFIGURE= yes +USE_AUTOTOOLS= libtool +USE_OPENSSL= yes + +SUB_FILES= pkg-message + +USE_RC_SUBR= ${PORTNAME}d + +MAN8= knotc.8 knotd.8 + +PORTDOCS= AUTHORS ChangeLog CodingStyle COPYING \ + INSTALL KNOWN_ISSUES NEWS README RELNOTES + +post-install: + @${MKDIR} ${ETCDIR} + @${INSTALL_DATA} ${WRKSRC}/samples/knot.min.conf ${ETCDIR} + @if [ ! -f ${ETCDIR}/knot.conf ]; then \ + ${INSTALL_DATA} ${ETCDIR}/knot.min.conf ${ETCDIR}/knot.conf; \ + fi +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + @${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/ +.endif + +.include diff --git a/dns/knot/distinfo b/dns/knot/distinfo new file mode 100644 index 000000000000..fc1c5c6b769b --- /dev/null +++ b/dns/knot/distinfo @@ -0,0 +1,2 @@ +SHA256 (knot-1.0.1.tar.gz) = 0c18dd3c72a1d2df7708d45c638c83cf8a7a5b7ceafdb7c3350bebb2ca258f93 +SIZE (knot-1.0.1.tar.gz) = 1052858 diff --git a/dns/knot/files/knotd.in b/dns/knot/files/knotd.in new file mode 100644 index 000000000000..8605c706e97b --- /dev/null +++ b/dns/knot/files/knotd.in @@ -0,0 +1,56 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: knot +# REQUIRE: SERVERS cleanvar +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable knot: +# +# knot_enable="YES": Set to NO by default. +# Set it to YES to enable knot. +# knot_config="": Set to %%PREFIX%%/etc/knot/knot.conf +# by default. + +. /etc/rc.subr + +name=knot +rcvar=knot_enable + +extra_commands="reload compile" +compile_cmd="${name}_compile" +reload_cmd="${name}_reload" +start_precmd="${name}_compile" +status_cmd="${name}_status" +stop_cmd="${name}_stop" + +load_rc_config ${name} + +: ${knot_enable:="NO"} +: ${knot_config="%%PREFIX%%/etc/knot/knot.conf"} + +command=%%PREFIX%%/sbin/${name}c +procname=%%PREFIX%%/sbin/${name}d +pidfile=/var/run/${name}.pid + +command_args="-c ${knot_config} -w start" +required_files=${knot_config} + +knot_compile() { + echo "Compiling zone(s)..." + ${command} -c ${knot_config} compile + } +knot_reload() { + echo "Reloading ${name}." + ${command} -c ${knot_config} -a reload + } +knot_status() { + ${command} -c ${knot_config} running + } +knot_stop() { + echo "Stopping ${name}." + ${command} -c ${knot_config} stop + } + +run_rc_command "$1" diff --git a/dns/knot/files/pkg-message.in b/dns/knot/files/pkg-message.in new file mode 100644 index 000000000000..72e230f77333 --- /dev/null +++ b/dns/knot/files/pkg-message.in @@ -0,0 +1,29 @@ + +#################################################################### +# +# To start using Knot DNS, you should complete the following tasks: +# +# ----- configure -------------------------------------------------- +# + $EDITOR %%PREFIX%%/etc/knot/knot.conf +# +# For all option have a look at the contents of +# %%PREFIX%%/etc/knot/knot.sample.conf +# +# For example, under "system" you might like to add +# user "bind.bind"; +# to not have knotd run as root/wheel +# +# ----- prepare ---------------------------------------------------- +# +# required: + echo knot_enable=\"YES\" >> /etc/rc.conf +# for customization if desired: +# echo knot_config=\"%%PREFIX%%/etc/knot/knot.conf" >> /etc/rc.conf +# +# ----- startup ---------------------------------------------------- +# + %%PREFIX%%/etc/rc.d/knot start +# +#################################################################### + diff --git a/dns/knot/pkg-descr b/dns/knot/pkg-descr new file mode 100644 index 000000000000..e7fc9d369906 --- /dev/null +++ b/dns/knot/pkg-descr @@ -0,0 +1,20 @@ +Knot DNS is a high-performance authoritative-only DNS server +which supports all key features of the domain name system +including zone transfers, dynamic updates and DNSSEC. + +Key features: + + - Open source + + - High-performance, multi-threaded, and mostly + lock-free implementation which scales well on SMPs + + - Object-oriented design + + - Support for all important DNS protocols: + - Full and incremental zone transfers + - EDNS0 and DNSSEC extensions, including NSEC3 + - NSID + + +WWW: http://www.knot-dns.cz/ diff --git a/dns/knot/pkg-plist b/dns/knot/pkg-plist new file mode 100644 index 000000000000..9c61f22454a2 --- /dev/null +++ b/dns/knot/pkg-plist @@ -0,0 +1,16 @@ +@comment $FreeBSD$ +@stopdaemon knotd +%%ETCDIR%%/example.com.zone +@unexec if cmp -s %B/knot.min.conf %B/knot.conf; then rm -f %B/knot.conf; fi +%%ETCDIR%%/knot.min.conf +@exec [ -f %B/knot.conf ] || cp %B/%f %B/knot.conf +%%ETCDIR%%/knot.sample.conf +libexec/knot-zcompile +libexec/unittests +libexec/unittests-libknot +libexec/unittests-libknot-realdata +libexec/unittests-xfr +libexec/unittests-zcompile +sbin/knotc +sbin/knotd +@dirrmtry %%ETCDIR%%