diff options
author | dinoex <dinoex@FreeBSD.org> | 2003-01-20 14:10:35 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2003-01-20 14:10:35 +0800 |
commit | abd7fc12483fccd9efb9d13b2313a30b5c666683 (patch) | |
tree | 1600b22e5f6048cc38b29f7bcff0c57e02c2ccbc /dns | |
parent | 42c04c0ba092ba8858cbd460b3b5e3dea1a7bfe8 (diff) | |
download | freebsd-ports-gnome-abd7fc12483fccd9efb9d13b2313a30b5c666683.tar.gz freebsd-ports-gnome-abd7fc12483fccd9efb9d13b2313a30b5c666683.tar.zst freebsd-ports-gnome-abd7fc12483fccd9efb9d13b2313a30b5c666683.zip |
PowerDNS is an advanced DNS server, which allows for several different
backends. Current backends include MySQL, PostgreSQL, bind, etc.
WWW: http://www.powerdns.com/
License: GPL
Patches obtained from: OpenBSD <maurice@amaze.nl>
Diffstat (limited to 'dns')
36 files changed, 1518 insertions, 0 deletions
diff --git a/dns/powerdns-devel/Makefile b/dns/powerdns-devel/Makefile new file mode 100644 index 000000000000..ac8e87e0ecdf --- /dev/null +++ b/dns/powerdns-devel/Makefile @@ -0,0 +1,84 @@ +# New ports collection makefile for: powerdns +# Date Created: 14.Jan 2003 +# Whom: dirk.meyer@dinoex.sub.org +# +# $FreeBSD$ +# + +PORTNAME= powerdns +PORTVERSION= 2.9.4 +CATEGORIES= net ipv6 +MASTER_SITES= http://downloads.powerdns.com/releases/ +DISTNAME= pdns-${PORTVERSION} + +MAINTAINER= dinoex@FreeBSD.org + +USE_GMAKE= YES +USE_SUBMAKE= YES +GNU_CONFIGURE= YES +CONFIGURE_ARGS+= --with-modules="${CONFIGURE_MODULES} pipe" \ + --with-dynmodules="" +# --enable-debug + +# use user config if possible +.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) +.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" +.else +.if defined(BATCH) +# default package, can be configured in /etc/make.conf +POWERDNS_OPTIONS?= \"PostgreSQL\" +.endif +# make INDEX match +NO_DESCRIBE=yes +.endif + +.if defined(WITH_POSTGRESQL_DRIVER) && !defined(WITHOUT_POSTGRESQL_DRIVER) +LIB_DEPENDS= pq++.4:${PORTSDIR}/databases/postgresql-libpq++ +CONFIGURE_ARGS+= --enable-pgsql +CONFIGURE_MODULES+= "gpgsql" +.else +CONFIGURE_ARGS+= --disable-pgsql +.endif + +.if defined(WITH_MYSQL_DRIVER) +LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client +CONFIGURE_ARGS+= --enable-mysql +CONFIGURE_MODULES+= "gmysql" +.else +CONFIGURE_ARGS+= --disable-mysql +.endif + +SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ + CURDIR="${.CURDIR}" \ + MKDIR="${MKDIR}" \ + DISTNAME="${DISTNAME}" \ + POWERDNS_OPTIONS="${POWERDNS_OPTIONS}" + +MAN8= pdns_control.8 pdns_server.8 zone2sql.8 + +pre-everything: + @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.powerdns + +post-install: +.if !exists(${PREFIX}/etc/pdns.conf) + ${INSTALL_DATA} ${PREFIX}/etc/pdns.conf-dist ${PREFIX}/etc/pdns.conf +.endif +.if !defined(NOPORTDOCS) + ${MKDIR} ${EXAMPLESDIR} +.for i in pdns.conf pdns_mysql.sql pdns_postgresql.sql + ${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/ +.endfor +.endif + +post-clean: + @ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc + +.if defined(NO_DESCRIBE) +describe: +.if defined(BATCH) + @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.powerdns +.endif + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} BATCH=yes ${.TARGET} +.endif + +.include <bsd.port.mk> diff --git a/dns/powerdns-devel/distinfo b/dns/powerdns-devel/distinfo new file mode 100644 index 000000000000..845508a8f487 --- /dev/null +++ b/dns/powerdns-devel/distinfo @@ -0,0 +1 @@ +MD5 (pdns-2.9.4.tar.gz) = b59ebeae2ceb10cb13710e772708678a diff --git a/dns/powerdns-devel/files/configure.powerdns b/dns/powerdns-devel/files/configure.powerdns new file mode 100644 index 000000000000..e41c817d67e2 --- /dev/null +++ b/dns/powerdns-devel/files/configure.powerdns @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $FreeBSD$ +# +if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then + exit +fi + +if [ "${POWERDNS_OPTIONS}" ]; then + set ${POWERDNS_OPTIONS} +else + dialog --title "configuration options" --clear \ + --checklist "\n\ +Please select desired options:" -1 -1 2 \ +PostgreSQL "PostgreSQL driver" ON \ +MySQL "MySQL driver" OFF \ +2> /tmp/checklist.tmp.$$ + + retval=$? + if [ -s /tmp/checklist.tmp.$$ ]; then + set `cat /tmp/checklist.tmp.$$` + fi + rm -f /tmp/checklist.tmp.$$ + + case $retval in + 0) if [ -z "$*" ]; then + echo "Nothing selected" + fi + ;; + 1) echo "Cancel pressed." + exit 1 + ;; + esac +fi + +${MKDIR} ${WRKDIRPREFIX}${CURDIR} +exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + +while [ "$1" ]; do + case $1 in + \"PostgreSQL\") + echo WITH_POSTGRESQL_DRIVER=YES + ;; + \"MySQL\") + echo WITH_MYSQL_DRIVER=YES + ;; + \"nothing\"|true) + ;; + *) + echo "Invalid option(s): $*" > /dev/stderr + rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + exit 1 + ;; + esac + shift +done +exec > /dev/stderr diff --git a/dns/powerdns-devel/files/patch-configure b/dns/powerdns-devel/files/patch-configure new file mode 100644 index 000000000000..f4121d2c92d6 --- /dev/null +++ b/dns/powerdns-devel/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Mon Dec 16 22:45:46 2002 ++++ configure Mon Dec 16 22:45:59 2002 +@@ -10385,7 +10385,7 @@ + echo "$as_me:$LINENO: result: $PGSQL_incdir" >&5 + echo "${ECHO_T}$PGSQL_incdir" >&6 + +-# LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto" ++# LIBS="$LIBS -lpq++ -lpq -lssl -lcrypto" + fi + + diff --git a/dns/powerdns-devel/files/patch-modules_gmysqlbackend_Makefile_in b/dns/powerdns-devel/files/patch-modules_gmysqlbackend_Makefile_in new file mode 100644 index 000000000000..dc74b8e00628 --- /dev/null +++ b/dns/powerdns-devel/files/patch-modules_gmysqlbackend_Makefile_in @@ -0,0 +1,11 @@ +--- modules/gmysqlbackend/Makefile.in.orig Tue Dec 17 10:38:38 2002 ++++ modules/gmysqlbackend/Makefile.in Tue Dec 17 10:38:39 2002 +@@ -181,7 +181,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libgmysqlbackend.la: $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libgmysqlbackend_la_LDFLAGS) $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libgmysqlbackend_la_LDFLAGS) $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns-devel/files/patch-modules_gmysqlbackend_gmysqlbackend_cc b/dns/powerdns-devel/files/patch-modules_gmysqlbackend_gmysqlbackend_cc new file mode 100644 index 000000000000..300ff8a3b445 --- /dev/null +++ b/dns/powerdns-devel/files/patch-modules_gmysqlbackend_gmysqlbackend_cc @@ -0,0 +1,23 @@ +--- modules/gmysqlbackend/gmysqlbackend.cc.orig Tue Dec 17 10:56:43 2002 ++++ modules/gmysqlbackend/gmysqlbackend.cc Tue Dec 17 11:01:33 2002 +@@ -20,13 +20,14 @@ + + gMySQLBackend::gMySQLBackend(const string &mode, const string &suffix) : GSQLBackend(mode,suffix) + { ++ const string dbname = getArg ("dbname"); ++ const string host = getArg ("host"); ++ const string socket = getArg ("socket"); ++ const string user = getArg ("user"); ++ const string passwd = getArg ("password"); ++ + try { +- setDB(new SMySQL(getArg("dbname"), +- getArg("host"), +- getArg("socket"), +- getArg("user"), +- getArg("password"))); +- ++ setDB(new SMySQL(dbname, host, socket, user, passwd)); + } + + catch(SSqlException &e) { diff --git a/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_Makefile_in b/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_Makefile_in new file mode 100644 index 000000000000..a6342919d3fd --- /dev/null +++ b/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_Makefile_in @@ -0,0 +1,29 @@ +--- modules/gpgsqlbackend/Makefile.in.orig Mon Dec 16 22:32:29 2002 ++++ modules/gpgsqlbackend/Makefile.in Fri Dec 20 14:24:06 2002 +@@ -95,7 +95,7 @@ + lib_LTLIBRARIES = libgpgsqlbackend.la + + EXTRA_DIST = OBJECTFILES OBJECTLIBS +-INCLUDES = -I@PGSQL_incdir@ ++INCLUDES = -I@includedir@ -I@PGSQL_incdir@ + + libgpgsqlbackend_la_SOURCES = gpgsqlbackend.cc gpgsqlbackend.hh \ + spgsql.hh spgsql.cc +@@ -105,7 +105,7 @@ + -Wl,-Bdynamic + + +-libgpgsqlbackend_la_LIBADD = -lssl -lcrypt -lcrypto ++libgpgsqlbackend_la_LIBADD = -lssl -lcrypto + subdir = modules/gpgsqlbackend + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h +@@ -184,7 +184,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libgpgsqlbackend.la: $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libgpgsqlbackend_la_LDFLAGS) $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libgpgsqlbackend_la_LDFLAGS) $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_OBJECTLIBS b/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_OBJECTLIBS new file mode 100644 index 000000000000..200a917059a1 --- /dev/null +++ b/dns/powerdns-devel/files/patch-modules_gpgsqlbackend_OBJECTLIBS @@ -0,0 +1,5 @@ +--- modules/gpgsqlbackend/OBJECTLIBS.orig Tue Dec 17 08:35:41 2002 ++++ modules/gpgsqlbackend/OBJECTLIBS Tue Dec 17 08:35:50 2002 +@@ -1 +1 @@ +--lpq++ -lpq -lssl -lcrypt -lcrypto ++-lpq++ -lpq -lssl -lcrypto diff --git a/dns/powerdns-devel/files/patch-modules_pipebackend_Makefile_in b/dns/powerdns-devel/files/patch-modules_pipebackend_Makefile_in new file mode 100644 index 000000000000..c166925057b6 --- /dev/null +++ b/dns/powerdns-devel/files/patch-modules_pipebackend_Makefile_in @@ -0,0 +1,11 @@ +--- modules/pipebackend/Makefile.in.orig Tue Dec 17 09:39:14 2002 ++++ modules/pipebackend/Makefile.in Tue Dec 17 09:39:39 2002 +@@ -181,7 +181,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libpipebackend.la: $(libpipebackend_la_OBJECTS) $(libpipebackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libpipebackend_la_LDFLAGS) $(libpipebackend_la_OBJECTS) $(libpipebackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libpipebackend_la_LDFLAGS) $(libpipebackend_la_OBJECTS) $(libpipebackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns-devel/files/patch-pdns_common_startup_cc b/dns/powerdns-devel/files/patch-pdns_common_startup_cc new file mode 100644 index 000000000000..939539a58a66 --- /dev/null +++ b/dns/powerdns-devel/files/patch-pdns_common_startup_cc @@ -0,0 +1,15 @@ +--- pdns/common_startup.cc.orig Tue Dec 17 08:18:41 2002 ++++ pdns/common_startup.cc Tue Dec 17 08:19:58 2002 +@@ -270,8 +270,10 @@ + TN->go(); // tcp nameserver launch + + // fork(); (this worked :-)) +- for(int n=0;n<arg().asNum("receiver-threads");++n) { +- DNSDistributor *D= new DNSDistributor(arg().asNum("distributor-threads")); // the big dispatcher! ++ int foo1 = arg().asNum("receiver-threads"); ++ for(int n=0;n<foo1;++n) { ++ int foo2 = arg().asNum("distributor-threads"); ++ DNSDistributor *D= new DNSDistributor(foo2); // the big dispatcher! + pthread_create(&qtid,0,qthread,static_cast<void *>(D)); // receives packets + } + diff --git a/dns/powerdns-devel/files/pdns.conf b/dns/powerdns-devel/files/pdns.conf new file mode 100644 index 000000000000..a45251872b73 --- /dev/null +++ b/dns/powerdns-devel/files/pdns.conf @@ -0,0 +1,300 @@ +# MySQL +#launch=gmysql +#gmysql-host=127.0.0.1 +#gmysql-dbname=pdns +#gmysql-user=pdns +#gmysql-password=pdns + +# PostgreSQL +#launch=gpgsql +#gpgsql-host=127.0.0.1 +#gpgsql-dbname=pdns +#gpgsql-user=pdns +#gpgsql-password=pdns + +################################# +# allow-axfr-ips If disabled, DO allow zonetransfers from these IP addresses +# +# allow-axfr-ips= + +################################# +# allow-recursion List of netmasks that are allowed to recurse +# +# allow-recursion= + +################################# +# cache-ttl Seconds to store packets in the PacketCache +# +# cache-ttl=20 + +################################# +# chroot If set, chroot to this directory for more security +# +chroot=/var/empty + +################################# +# config-dir Location of configuration directory (pdns.conf) +# +# config-dir=/etc + +################################# +# config-name Name of this virtual configuration - will rename the binary image +# +# config-name= + +################################# +# control-console Debugging switch - don't use +# +# control-console=no + +################################# +# daemon Operate as a daemon +# +daemon=yes + +################################# +# default-soa-name name to insert in the SOA record if none set in the backend +# +# default-soa-name=ns.example.com + +################################# +# disable-axfr Disable zonetransfers but do allow TCP queries +# +# disable-axfr=no + +################################# +# disable-tcp Do not listen to TCP queries +# +disable-tcp=no + +################################# +# distributor-threads Default number of Distributor (backend) threads to start +# +# distributor-threads=3 + +################################# +# fancy-records Process URL and MBOXFW records +# +# fancy-records=no + +################################# +# guardian Run within a guardian process +# +guardian=yes + +################################# +# launch Which backends to launch and order to query them in +# +# launch= + +################################# +# lazy-recursion Only recurse if question cannot be answered locally +# +# lazy-recursion=yes + +################################# +# load-modules Load this module - supply absolute or relative path +# +# load-modules= + +################################# +# local-address Local IP address to which we bind +# +# local-address=0.0.0.0 + +################################# +# local-ipv6 Local IP address to which we bind +# +# local-ipv6= + +################################# +# local-port The port on which we listen +# +# local-port=53 + +################################# +# log-dns-details If PDNS should log failed update requests +# +# log-dns-details= + +################################# +# log-failed-updates If PDNS should log failed update requests +# +# log-failed-updates= + +################################# +# logfile Logfile to use +# +# logfile=pdns.log + +################################# +# logging-facility Log under a specific facility +# +# logging-facility= + +################################# +# loglevel Amount of logging. Higher is more. Do not set below 3 +# +# loglevel=4 + +################################# +# master Act as a master +# +# master=no + +################################# +# max-queue-length Maximum queuelength before considering situation lost +# +# max-queue-length=5000 + +################################# +# max-tcp-connections Maximum number of TCP connections +# +# max-tcp-connections=10 + +################################# +# module-dir Default directory for modules +# +# module-dir=/usr/local/bin/../lib + +################################# +# negquery-cache-ttl Seconds to store packets in the PacketCache +# +# negquery-cache-ttl=60 + +################################# +# only-soa Make sure that no SOA serial is less than this number +# +# only-soa=org + +################################# +# out-of-zone-additional-processing Do out of zone additional processing +# +# out-of-zone-additional-processing=no + +################################# +# query-cache-ttl Seconds to store packets in the PacketCache +# +# query-cache-ttl=20 + +################################# +# query-logging Hint backends that queries should be logged +# +# query-logging=no + +################################# +# queue-limit Maximum number of milliseconds to queue a query +# +# queue-limit=1500 + +################################# +# receiver-threads Number of receiver threads to launch +# +# receiver-threads=1 + +################################# +# recursive-cache-ttl Seconds to store packets in the PacketCache +# +# recursive-cache-ttl=10 + +################################# +# recursor If recursion is desired, IP address of a recursing nameserver +# +# recursor=no + +################################# +# setgid If set, change group id to this gid for more security +# +# setgid= + +################################# +# setuid If set, change user id to this uid for more security +# +# setuid= + +################################# +# skip-cname Do not perform CNAME indirection for each query +# +# skip-cname=no + +################################# +# slave Act as a slave +# +# slave=no + +################################# +# slave-cycle-interval Reschedule failed SOA serial checks once every .. seconds +# +# slave-cycle-interval=60 + +################################# +# smtpredirector Our smtpredir MX host +# +smtpredirector=voodoo.codeninja.nl + +################################# +# soa-minimum-ttl Default SOA mininum ttl +# +# soa-minimum-ttl=3600 + +################################# +# soa-serial-offset Make sure that no SOA serial is less than this number +# +# soa-serial-offset=0 + +################################# +# socket-dir Where the controlsocket will live +# +# socket-dir=/var/run + +################################# +# strict-rfc-axfrs Perform strictly rfc compliant axfrs (very slow) +# +# strict-rfc-axfrs=no + +################################# +# urlredirector Where we send hosts to that need to be url redirected +# +# urlredirector=127.0.0.1 + +################################# +# use-logfile Use a log file +# +# use-logfile=no + +################################# +# webserver Start a webserver for monitoring +# +webserver=yes + +################################# +# webserver-address IP Address of webserver to listen on +# +webserver-address=127.0.0.1 + +################################# +# webserver-password Password required for accessing the webserver +# +# webserver-password= + +################################# +# webserver-port Port of webserver to listen on +# +webserver-port=8081 + +################################# +# webserver-print-arguments If the webserver should print arguments +# +# webserver-print-arguments=no + +################################# +# wildcard-url Process URL and MBOXFW records +# +# wildcard-url=no + +################################# +# wildcards Honor wildcards in the database +# +# wildcards= + + diff --git a/dns/powerdns-devel/files/pdns_mysql.sql b/dns/powerdns-devel/files/pdns_mysql.sql new file mode 100644 index 000000000000..278c5d56c61c --- /dev/null +++ b/dns/powerdns-devel/files/pdns_mysql.sql @@ -0,0 +1,38 @@ +create table domains ( + id INT auto_increment, + name VARCHAR(255) NOT NULL, + master VARCHAR(20) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL, + primary key (id) +)type=InnoDB; + +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id INT auto_increment, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + primary key(id) +)type=InnoDB; + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); + +create table supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL +); + +GRANT SELECT ON supermasters TO pdns; +GRANT ALL ON domains TO pdns; +GRANT ALL ON records TO pdns; diff --git a/dns/powerdns-devel/files/pdns_postgresql.sql b/dns/powerdns-devel/files/pdns_postgresql.sql new file mode 100644 index 000000000000..c700a2aa6dc2 --- /dev/null +++ b/dns/powerdns-devel/files/pdns_postgresql.sql @@ -0,0 +1,40 @@ +create table domains ( + id SERIAL PRIMARY KEY, + name VARCHAR(255) NOT NULL, + master VARCHAR(20) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL +); +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id SERIAL PRIMARY KEY, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + CONSTRAINT domain_exists + FOREIGN KEY(domain_id) REFERENCES domains(id) + ON DELETE CASCADE +); + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); + +create table supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL +); + +GRANT SELECT ON supermasters TO pdns; +GRANT ALL ON domains TO pdns; +GRANT ALL ON domains_id_seq TO pdns; +GRANT ALL ON records TO pdns; +GRANT ALL ON records_id_seq TO pdns; diff --git a/dns/powerdns-devel/pkg-comment b/dns/powerdns-devel/pkg-comment new file mode 100644 index 000000000000..7a26d04e5458 --- /dev/null +++ b/dns/powerdns-devel/pkg-comment @@ -0,0 +1 @@ +An advanced DNS server with SQL backend diff --git a/dns/powerdns-devel/pkg-deinstall b/dns/powerdns-devel/pkg-deinstall new file mode 100644 index 000000000000..ff77eb95919b --- /dev/null +++ b/dns/powerdns-devel/pkg-deinstall @@ -0,0 +1,26 @@ +#!/bin/sh +# $OpenBSD$ +# +# powerdns de-installation + +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${SYSCONFDIR} +CONFIG_FILE=$CONFIG_DIR/pdns.conf + +if [ -f ${CONFIG_FILE} ]; then + echo + echo "+---------------" + echo "| To completely deinstall the $1 package you need" + echo "| to perform these steps as root:" + echo "|" + echo "| rm -rf $CONFIG_FILE" + echo "|" + echo "| Do not do this if you plan on re-installing $1" + echo "| at some future time." + echo "+---------------" + echo +fi + +exit 0 diff --git a/dns/powerdns-devel/pkg-descr b/dns/powerdns-devel/pkg-descr new file mode 100644 index 000000000000..9e1d2d6dbb2d --- /dev/null +++ b/dns/powerdns-devel/pkg-descr @@ -0,0 +1,6 @@ +PowerDNS is an advanced DNS server, which allows for several different +backends. Current backends include MySQL, PostgreSQL, bind, etc. + +License: GPL V2 + +WWW: http://www.powerdns.com/ diff --git a/dns/powerdns-devel/pkg-install b/dns/powerdns-devel/pkg-install new file mode 100644 index 000000000000..887a8d16c9ce --- /dev/null +++ b/dns/powerdns-devel/pkg-install @@ -0,0 +1,91 @@ +#!/bin/sh +# $OpenBSD$ +# +# Pre/post-installation setup of powerdns + +# exit on errors, use a sane path and install prefix +# +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${SYSCONFDIR} +CONFIG_FILE=$CONFIG_DIR/pdns.conf +SAMPLE_CONFIG_DIR=$PREFIX/share/examples/powerdns + +# Function: warn the user about possible problems with this port. +# +do_warning() +{ + echo "+---------------" + echo "| Be aware that PowerDNS still has some stability problems" + echo "| on OpenBSD. These problems might be the result of an too" + echo "| old or too buggy compiler." + echo "|" + echo "| In any case, don't expect PowerDNS to work flawlessly" + echo "| without dumping some core once in a while." + echo "+---------------" + echo +} + +# Function: tell the user what s/he needs to do to use the port just installed +# +do_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration files in $CONFIG_DIR," + echo "| have NOT been changed. You may want to compare them to the" + echo "| current sample files, $SAMPLE_CONFIG_DIR," + echo "| and update your configuration as needed." + echo "+---------------" + echo + + do_warning +} + +# Function: install the powerdns configuration file from the sample +# +do_install() +{ + install -d -o root -g wheel -m 755 $CONFIG_DIR + install -o root -g wheel -m 600 $SAMPLE_CONFIG_DIR/pdns.conf $CONFIG_FILE + echo + echo "+---------------" + echo "| The $1 configuration files in $CONFIG_DIR," + echo "| have been installed. Please view these files and change" + echo "| the configuration to meet your needs." + echo "+---------------" + echo + + do_warning +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + : nothing to pre-install for this port + ;; + POST-INSTALL) + if [ ! -d $CONFIG_DIR ]; then + do_install $1 + elif [ ! -f $CONFIG_FILE ]; then + do_install $1 + else + do_notice $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/dns/powerdns-devel/pkg-plist b/dns/powerdns-devel/pkg-plist new file mode 100644 index 000000000000..40a83b83e279 --- /dev/null +++ b/dns/powerdns-devel/pkg-plist @@ -0,0 +1,10 @@ +bin/pdns_control +bin/zone2sql +sbin/pdns_server +@unexec if cmp -s %D/etc/pdns.conf %D/etc/pdns.conf-dist; then rm -f %D/etc/pdns.conf; fi +etc/pdns.conf-dist +@exec [ -f %B/pdns.conf ] || cp %B/%f %B/pdns.conf +%%PORTDOCS%%share/examples/powerdns/pdns.conf +%%PORTDOCS%%share/examples/powerdns/pdns_mysql.sql +%%PORTDOCS%%share/examples/powerdns/pdns_postgresql.sql +%%PORTDOCS%%@dirrm share/examples/powerdns diff --git a/dns/powerdns/Makefile b/dns/powerdns/Makefile new file mode 100644 index 000000000000..ac8e87e0ecdf --- /dev/null +++ b/dns/powerdns/Makefile @@ -0,0 +1,84 @@ +# New ports collection makefile for: powerdns +# Date Created: 14.Jan 2003 +# Whom: dirk.meyer@dinoex.sub.org +# +# $FreeBSD$ +# + +PORTNAME= powerdns +PORTVERSION= 2.9.4 +CATEGORIES= net ipv6 +MASTER_SITES= http://downloads.powerdns.com/releases/ +DISTNAME= pdns-${PORTVERSION} + +MAINTAINER= dinoex@FreeBSD.org + +USE_GMAKE= YES +USE_SUBMAKE= YES +GNU_CONFIGURE= YES +CONFIGURE_ARGS+= --with-modules="${CONFIGURE_MODULES} pipe" \ + --with-dynmodules="" +# --enable-debug + +# use user config if possible +.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) +.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" +.else +.if defined(BATCH) +# default package, can be configured in /etc/make.conf +POWERDNS_OPTIONS?= \"PostgreSQL\" +.endif +# make INDEX match +NO_DESCRIBE=yes +.endif + +.if defined(WITH_POSTGRESQL_DRIVER) && !defined(WITHOUT_POSTGRESQL_DRIVER) +LIB_DEPENDS= pq++.4:${PORTSDIR}/databases/postgresql-libpq++ +CONFIGURE_ARGS+= --enable-pgsql +CONFIGURE_MODULES+= "gpgsql" +.else +CONFIGURE_ARGS+= --disable-pgsql +.endif + +.if defined(WITH_MYSQL_DRIVER) +LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client +CONFIGURE_ARGS+= --enable-mysql +CONFIGURE_MODULES+= "gmysql" +.else +CONFIGURE_ARGS+= --disable-mysql +.endif + +SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ + CURDIR="${.CURDIR}" \ + MKDIR="${MKDIR}" \ + DISTNAME="${DISTNAME}" \ + POWERDNS_OPTIONS="${POWERDNS_OPTIONS}" + +MAN8= pdns_control.8 pdns_server.8 zone2sql.8 + +pre-everything: + @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.powerdns + +post-install: +.if !exists(${PREFIX}/etc/pdns.conf) + ${INSTALL_DATA} ${PREFIX}/etc/pdns.conf-dist ${PREFIX}/etc/pdns.conf +.endif +.if !defined(NOPORTDOCS) + ${MKDIR} ${EXAMPLESDIR} +.for i in pdns.conf pdns_mysql.sql pdns_postgresql.sql + ${INSTALL_DATA} ${FILESDIR}/$i ${EXAMPLESDIR}/ +.endfor +.endif + +post-clean: + @ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc + +.if defined(NO_DESCRIBE) +describe: +.if defined(BATCH) + @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.powerdns +.endif + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} BATCH=yes ${.TARGET} +.endif + +.include <bsd.port.mk> diff --git a/dns/powerdns/distinfo b/dns/powerdns/distinfo new file mode 100644 index 000000000000..845508a8f487 --- /dev/null +++ b/dns/powerdns/distinfo @@ -0,0 +1 @@ +MD5 (pdns-2.9.4.tar.gz) = b59ebeae2ceb10cb13710e772708678a diff --git a/dns/powerdns/files/configure.powerdns b/dns/powerdns/files/configure.powerdns new file mode 100644 index 000000000000..e41c817d67e2 --- /dev/null +++ b/dns/powerdns/files/configure.powerdns @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $FreeBSD$ +# +if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then + exit +fi + +if [ "${POWERDNS_OPTIONS}" ]; then + set ${POWERDNS_OPTIONS} +else + dialog --title "configuration options" --clear \ + --checklist "\n\ +Please select desired options:" -1 -1 2 \ +PostgreSQL "PostgreSQL driver" ON \ +MySQL "MySQL driver" OFF \ +2> /tmp/checklist.tmp.$$ + + retval=$? + if [ -s /tmp/checklist.tmp.$$ ]; then + set `cat /tmp/checklist.tmp.$$` + fi + rm -f /tmp/checklist.tmp.$$ + + case $retval in + 0) if [ -z "$*" ]; then + echo "Nothing selected" + fi + ;; + 1) echo "Cancel pressed." + exit 1 + ;; + esac +fi + +${MKDIR} ${WRKDIRPREFIX}${CURDIR} +exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + +while [ "$1" ]; do + case $1 in + \"PostgreSQL\") + echo WITH_POSTGRESQL_DRIVER=YES + ;; + \"MySQL\") + echo WITH_MYSQL_DRIVER=YES + ;; + \"nothing\"|true) + ;; + *) + echo "Invalid option(s): $*" > /dev/stderr + rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + exit 1 + ;; + esac + shift +done +exec > /dev/stderr diff --git a/dns/powerdns/files/patch-configure b/dns/powerdns/files/patch-configure new file mode 100644 index 000000000000..f4121d2c92d6 --- /dev/null +++ b/dns/powerdns/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Mon Dec 16 22:45:46 2002 ++++ configure Mon Dec 16 22:45:59 2002 +@@ -10385,7 +10385,7 @@ + echo "$as_me:$LINENO: result: $PGSQL_incdir" >&5 + echo "${ECHO_T}$PGSQL_incdir" >&6 + +-# LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto" ++# LIBS="$LIBS -lpq++ -lpq -lssl -lcrypto" + fi + + diff --git a/dns/powerdns/files/patch-modules_gmysqlbackend_Makefile_in b/dns/powerdns/files/patch-modules_gmysqlbackend_Makefile_in new file mode 100644 index 000000000000..dc74b8e00628 --- /dev/null +++ b/dns/powerdns/files/patch-modules_gmysqlbackend_Makefile_in @@ -0,0 +1,11 @@ +--- modules/gmysqlbackend/Makefile.in.orig Tue Dec 17 10:38:38 2002 ++++ modules/gmysqlbackend/Makefile.in Tue Dec 17 10:38:39 2002 +@@ -181,7 +181,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libgmysqlbackend.la: $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libgmysqlbackend_la_LDFLAGS) $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libgmysqlbackend_la_LDFLAGS) $(libgmysqlbackend_la_OBJECTS) $(libgmysqlbackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns/files/patch-modules_gmysqlbackend_gmysqlbackend_cc b/dns/powerdns/files/patch-modules_gmysqlbackend_gmysqlbackend_cc new file mode 100644 index 000000000000..300ff8a3b445 --- /dev/null +++ b/dns/powerdns/files/patch-modules_gmysqlbackend_gmysqlbackend_cc @@ -0,0 +1,23 @@ +--- modules/gmysqlbackend/gmysqlbackend.cc.orig Tue Dec 17 10:56:43 2002 ++++ modules/gmysqlbackend/gmysqlbackend.cc Tue Dec 17 11:01:33 2002 +@@ -20,13 +20,14 @@ + + gMySQLBackend::gMySQLBackend(const string &mode, const string &suffix) : GSQLBackend(mode,suffix) + { ++ const string dbname = getArg ("dbname"); ++ const string host = getArg ("host"); ++ const string socket = getArg ("socket"); ++ const string user = getArg ("user"); ++ const string passwd = getArg ("password"); ++ + try { +- setDB(new SMySQL(getArg("dbname"), +- getArg("host"), +- getArg("socket"), +- getArg("user"), +- getArg("password"))); +- ++ setDB(new SMySQL(dbname, host, socket, user, passwd)); + } + + catch(SSqlException &e) { diff --git a/dns/powerdns/files/patch-modules_gpgsqlbackend_Makefile_in b/dns/powerdns/files/patch-modules_gpgsqlbackend_Makefile_in new file mode 100644 index 000000000000..a6342919d3fd --- /dev/null +++ b/dns/powerdns/files/patch-modules_gpgsqlbackend_Makefile_in @@ -0,0 +1,29 @@ +--- modules/gpgsqlbackend/Makefile.in.orig Mon Dec 16 22:32:29 2002 ++++ modules/gpgsqlbackend/Makefile.in Fri Dec 20 14:24:06 2002 +@@ -95,7 +95,7 @@ + lib_LTLIBRARIES = libgpgsqlbackend.la + + EXTRA_DIST = OBJECTFILES OBJECTLIBS +-INCLUDES = -I@PGSQL_incdir@ ++INCLUDES = -I@includedir@ -I@PGSQL_incdir@ + + libgpgsqlbackend_la_SOURCES = gpgsqlbackend.cc gpgsqlbackend.hh \ + spgsql.hh spgsql.cc +@@ -105,7 +105,7 @@ + -Wl,-Bdynamic + + +-libgpgsqlbackend_la_LIBADD = -lssl -lcrypt -lcrypto ++libgpgsqlbackend_la_LIBADD = -lssl -lcrypto + subdir = modules/gpgsqlbackend + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h +@@ -184,7 +184,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libgpgsqlbackend.la: $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libgpgsqlbackend_la_LDFLAGS) $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libgpgsqlbackend_la_LDFLAGS) $(libgpgsqlbackend_la_OBJECTS) $(libgpgsqlbackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns/files/patch-modules_gpgsqlbackend_OBJECTLIBS b/dns/powerdns/files/patch-modules_gpgsqlbackend_OBJECTLIBS new file mode 100644 index 000000000000..200a917059a1 --- /dev/null +++ b/dns/powerdns/files/patch-modules_gpgsqlbackend_OBJECTLIBS @@ -0,0 +1,5 @@ +--- modules/gpgsqlbackend/OBJECTLIBS.orig Tue Dec 17 08:35:41 2002 ++++ modules/gpgsqlbackend/OBJECTLIBS Tue Dec 17 08:35:50 2002 +@@ -1 +1 @@ +--lpq++ -lpq -lssl -lcrypt -lcrypto ++-lpq++ -lpq -lssl -lcrypto diff --git a/dns/powerdns/files/patch-modules_pipebackend_Makefile_in b/dns/powerdns/files/patch-modules_pipebackend_Makefile_in new file mode 100644 index 000000000000..c166925057b6 --- /dev/null +++ b/dns/powerdns/files/patch-modules_pipebackend_Makefile_in @@ -0,0 +1,11 @@ +--- modules/pipebackend/Makefile.in.orig Tue Dec 17 09:39:14 2002 ++++ modules/pipebackend/Makefile.in Tue Dec 17 09:39:39 2002 +@@ -181,7 +181,7 @@ + clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + libpipebackend.la: $(libpipebackend_la_OBJECTS) $(libpipebackend_la_DEPENDENCIES) +- $(CXXLINK) -rpath $(libdir) $(libpipebackend_la_LDFLAGS) $(libpipebackend_la_OBJECTS) $(libpipebackend_la_LIBADD) $(LIBS) ++# $(CXXLINK) -rpath $(libdir) $(libpipebackend_la_LDFLAGS) $(libpipebackend_la_OBJECTS) $(libpipebackend_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core diff --git a/dns/powerdns/files/patch-pdns_common_startup_cc b/dns/powerdns/files/patch-pdns_common_startup_cc new file mode 100644 index 000000000000..939539a58a66 --- /dev/null +++ b/dns/powerdns/files/patch-pdns_common_startup_cc @@ -0,0 +1,15 @@ +--- pdns/common_startup.cc.orig Tue Dec 17 08:18:41 2002 ++++ pdns/common_startup.cc Tue Dec 17 08:19:58 2002 +@@ -270,8 +270,10 @@ + TN->go(); // tcp nameserver launch + + // fork(); (this worked :-)) +- for(int n=0;n<arg().asNum("receiver-threads");++n) { +- DNSDistributor *D= new DNSDistributor(arg().asNum("distributor-threads")); // the big dispatcher! ++ int foo1 = arg().asNum("receiver-threads"); ++ for(int n=0;n<foo1;++n) { ++ int foo2 = arg().asNum("distributor-threads"); ++ DNSDistributor *D= new DNSDistributor(foo2); // the big dispatcher! + pthread_create(&qtid,0,qthread,static_cast<void *>(D)); // receives packets + } + diff --git a/dns/powerdns/files/pdns.conf b/dns/powerdns/files/pdns.conf new file mode 100644 index 000000000000..a45251872b73 --- /dev/null +++ b/dns/powerdns/files/pdns.conf @@ -0,0 +1,300 @@ +# MySQL +#launch=gmysql +#gmysql-host=127.0.0.1 +#gmysql-dbname=pdns +#gmysql-user=pdns +#gmysql-password=pdns + +# PostgreSQL +#launch=gpgsql +#gpgsql-host=127.0.0.1 +#gpgsql-dbname=pdns +#gpgsql-user=pdns +#gpgsql-password=pdns + +################################# +# allow-axfr-ips If disabled, DO allow zonetransfers from these IP addresses +# +# allow-axfr-ips= + +################################# +# allow-recursion List of netmasks that are allowed to recurse +# +# allow-recursion= + +################################# +# cache-ttl Seconds to store packets in the PacketCache +# +# cache-ttl=20 + +################################# +# chroot If set, chroot to this directory for more security +# +chroot=/var/empty + +################################# +# config-dir Location of configuration directory (pdns.conf) +# +# config-dir=/etc + +################################# +# config-name Name of this virtual configuration - will rename the binary image +# +# config-name= + +################################# +# control-console Debugging switch - don't use +# +# control-console=no + +################################# +# daemon Operate as a daemon +# +daemon=yes + +################################# +# default-soa-name name to insert in the SOA record if none set in the backend +# +# default-soa-name=ns.example.com + +################################# +# disable-axfr Disable zonetransfers but do allow TCP queries +# +# disable-axfr=no + +################################# +# disable-tcp Do not listen to TCP queries +# +disable-tcp=no + +################################# +# distributor-threads Default number of Distributor (backend) threads to start +# +# distributor-threads=3 + +################################# +# fancy-records Process URL and MBOXFW records +# +# fancy-records=no + +################################# +# guardian Run within a guardian process +# +guardian=yes + +################################# +# launch Which backends to launch and order to query them in +# +# launch= + +################################# +# lazy-recursion Only recurse if question cannot be answered locally +# +# lazy-recursion=yes + +################################# +# load-modules Load this module - supply absolute or relative path +# +# load-modules= + +################################# +# local-address Local IP address to which we bind +# +# local-address=0.0.0.0 + +################################# +# local-ipv6 Local IP address to which we bind +# +# local-ipv6= + +################################# +# local-port The port on which we listen +# +# local-port=53 + +################################# +# log-dns-details If PDNS should log failed update requests +# +# log-dns-details= + +################################# +# log-failed-updates If PDNS should log failed update requests +# +# log-failed-updates= + +################################# +# logfile Logfile to use +# +# logfile=pdns.log + +################################# +# logging-facility Log under a specific facility +# +# logging-facility= + +################################# +# loglevel Amount of logging. Higher is more. Do not set below 3 +# +# loglevel=4 + +################################# +# master Act as a master +# +# master=no + +################################# +# max-queue-length Maximum queuelength before considering situation lost +# +# max-queue-length=5000 + +################################# +# max-tcp-connections Maximum number of TCP connections +# +# max-tcp-connections=10 + +################################# +# module-dir Default directory for modules +# +# module-dir=/usr/local/bin/../lib + +################################# +# negquery-cache-ttl Seconds to store packets in the PacketCache +# +# negquery-cache-ttl=60 + +################################# +# only-soa Make sure that no SOA serial is less than this number +# +# only-soa=org + +################################# +# out-of-zone-additional-processing Do out of zone additional processing +# +# out-of-zone-additional-processing=no + +################################# +# query-cache-ttl Seconds to store packets in the PacketCache +# +# query-cache-ttl=20 + +################################# +# query-logging Hint backends that queries should be logged +# +# query-logging=no + +################################# +# queue-limit Maximum number of milliseconds to queue a query +# +# queue-limit=1500 + +################################# +# receiver-threads Number of receiver threads to launch +# +# receiver-threads=1 + +################################# +# recursive-cache-ttl Seconds to store packets in the PacketCache +# +# recursive-cache-ttl=10 + +################################# +# recursor If recursion is desired, IP address of a recursing nameserver +# +# recursor=no + +################################# +# setgid If set, change group id to this gid for more security +# +# setgid= + +################################# +# setuid If set, change user id to this uid for more security +# +# setuid= + +################################# +# skip-cname Do not perform CNAME indirection for each query +# +# skip-cname=no + +################################# +# slave Act as a slave +# +# slave=no + +################################# +# slave-cycle-interval Reschedule failed SOA serial checks once every .. seconds +# +# slave-cycle-interval=60 + +################################# +# smtpredirector Our smtpredir MX host +# +smtpredirector=voodoo.codeninja.nl + +################################# +# soa-minimum-ttl Default SOA mininum ttl +# +# soa-minimum-ttl=3600 + +################################# +# soa-serial-offset Make sure that no SOA serial is less than this number +# +# soa-serial-offset=0 + +################################# +# socket-dir Where the controlsocket will live +# +# socket-dir=/var/run + +################################# +# strict-rfc-axfrs Perform strictly rfc compliant axfrs (very slow) +# +# strict-rfc-axfrs=no + +################################# +# urlredirector Where we send hosts to that need to be url redirected +# +# urlredirector=127.0.0.1 + +################################# +# use-logfile Use a log file +# +# use-logfile=no + +################################# +# webserver Start a webserver for monitoring +# +webserver=yes + +################################# +# webserver-address IP Address of webserver to listen on +# +webserver-address=127.0.0.1 + +################################# +# webserver-password Password required for accessing the webserver +# +# webserver-password= + +################################# +# webserver-port Port of webserver to listen on +# +webserver-port=8081 + +################################# +# webserver-print-arguments If the webserver should print arguments +# +# webserver-print-arguments=no + +################################# +# wildcard-url Process URL and MBOXFW records +# +# wildcard-url=no + +################################# +# wildcards Honor wildcards in the database +# +# wildcards= + + diff --git a/dns/powerdns/files/pdns_mysql.sql b/dns/powerdns/files/pdns_mysql.sql new file mode 100644 index 000000000000..278c5d56c61c --- /dev/null +++ b/dns/powerdns/files/pdns_mysql.sql @@ -0,0 +1,38 @@ +create table domains ( + id INT auto_increment, + name VARCHAR(255) NOT NULL, + master VARCHAR(20) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL, + primary key (id) +)type=InnoDB; + +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id INT auto_increment, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + primary key(id) +)type=InnoDB; + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); + +create table supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL +); + +GRANT SELECT ON supermasters TO pdns; +GRANT ALL ON domains TO pdns; +GRANT ALL ON records TO pdns; diff --git a/dns/powerdns/files/pdns_postgresql.sql b/dns/powerdns/files/pdns_postgresql.sql new file mode 100644 index 000000000000..c700a2aa6dc2 --- /dev/null +++ b/dns/powerdns/files/pdns_postgresql.sql @@ -0,0 +1,40 @@ +create table domains ( + id SERIAL PRIMARY KEY, + name VARCHAR(255) NOT NULL, + master VARCHAR(20) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL +); +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id SERIAL PRIMARY KEY, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + CONSTRAINT domain_exists + FOREIGN KEY(domain_id) REFERENCES domains(id) + ON DELETE CASCADE +); + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); + +create table supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL +); + +GRANT SELECT ON supermasters TO pdns; +GRANT ALL ON domains TO pdns; +GRANT ALL ON domains_id_seq TO pdns; +GRANT ALL ON records TO pdns; +GRANT ALL ON records_id_seq TO pdns; diff --git a/dns/powerdns/pkg-comment b/dns/powerdns/pkg-comment new file mode 100644 index 000000000000..7a26d04e5458 --- /dev/null +++ b/dns/powerdns/pkg-comment @@ -0,0 +1 @@ +An advanced DNS server with SQL backend diff --git a/dns/powerdns/pkg-deinstall b/dns/powerdns/pkg-deinstall new file mode 100644 index 000000000000..ff77eb95919b --- /dev/null +++ b/dns/powerdns/pkg-deinstall @@ -0,0 +1,26 @@ +#!/bin/sh +# $OpenBSD$ +# +# powerdns de-installation + +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${SYSCONFDIR} +CONFIG_FILE=$CONFIG_DIR/pdns.conf + +if [ -f ${CONFIG_FILE} ]; then + echo + echo "+---------------" + echo "| To completely deinstall the $1 package you need" + echo "| to perform these steps as root:" + echo "|" + echo "| rm -rf $CONFIG_FILE" + echo "|" + echo "| Do not do this if you plan on re-installing $1" + echo "| at some future time." + echo "+---------------" + echo +fi + +exit 0 diff --git a/dns/powerdns/pkg-descr b/dns/powerdns/pkg-descr new file mode 100644 index 000000000000..9e1d2d6dbb2d --- /dev/null +++ b/dns/powerdns/pkg-descr @@ -0,0 +1,6 @@ +PowerDNS is an advanced DNS server, which allows for several different +backends. Current backends include MySQL, PostgreSQL, bind, etc. + +License: GPL V2 + +WWW: http://www.powerdns.com/ diff --git a/dns/powerdns/pkg-install b/dns/powerdns/pkg-install new file mode 100644 index 000000000000..887a8d16c9ce --- /dev/null +++ b/dns/powerdns/pkg-install @@ -0,0 +1,91 @@ +#!/bin/sh +# $OpenBSD$ +# +# Pre/post-installation setup of powerdns + +# exit on errors, use a sane path and install prefix +# +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${SYSCONFDIR} +CONFIG_FILE=$CONFIG_DIR/pdns.conf +SAMPLE_CONFIG_DIR=$PREFIX/share/examples/powerdns + +# Function: warn the user about possible problems with this port. +# +do_warning() +{ + echo "+---------------" + echo "| Be aware that PowerDNS still has some stability problems" + echo "| on OpenBSD. These problems might be the result of an too" + echo "| old or too buggy compiler." + echo "|" + echo "| In any case, don't expect PowerDNS to work flawlessly" + echo "| without dumping some core once in a while." + echo "+---------------" + echo +} + +# Function: tell the user what s/he needs to do to use the port just installed +# +do_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration files in $CONFIG_DIR," + echo "| have NOT been changed. You may want to compare them to the" + echo "| current sample files, $SAMPLE_CONFIG_DIR," + echo "| and update your configuration as needed." + echo "+---------------" + echo + + do_warning +} + +# Function: install the powerdns configuration file from the sample +# +do_install() +{ + install -d -o root -g wheel -m 755 $CONFIG_DIR + install -o root -g wheel -m 600 $SAMPLE_CONFIG_DIR/pdns.conf $CONFIG_FILE + echo + echo "+---------------" + echo "| The $1 configuration files in $CONFIG_DIR," + echo "| have been installed. Please view these files and change" + echo "| the configuration to meet your needs." + echo "+---------------" + echo + + do_warning +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + : nothing to pre-install for this port + ;; + POST-INSTALL) + if [ ! -d $CONFIG_DIR ]; then + do_install $1 + elif [ ! -f $CONFIG_FILE ]; then + do_install $1 + else + do_notice $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/dns/powerdns/pkg-plist b/dns/powerdns/pkg-plist new file mode 100644 index 000000000000..40a83b83e279 --- /dev/null +++ b/dns/powerdns/pkg-plist @@ -0,0 +1,10 @@ +bin/pdns_control +bin/zone2sql +sbin/pdns_server +@unexec if cmp -s %D/etc/pdns.conf %D/etc/pdns.conf-dist; then rm -f %D/etc/pdns.conf; fi +etc/pdns.conf-dist +@exec [ -f %B/pdns.conf ] || cp %B/%f %B/pdns.conf +%%PORTDOCS%%share/examples/powerdns/pdns.conf +%%PORTDOCS%%share/examples/powerdns/pdns_mysql.sql +%%PORTDOCS%%share/examples/powerdns/pdns_postgresql.sql +%%PORTDOCS%%@dirrm share/examples/powerdns |