pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/djbdns-run With the 'inet6' option, depend on djbd...
details: https://anonhg.NetBSD.org/pkgsrc/rev/52164c91e40c
branches: trunk
changeset: 389724:52164c91e40c
user: schmonz <schmonz%pkgsrc.org@localhost>
date: Mon Jan 07 14:01:55 2019 +0000
description:
With the 'inet6' option, depend on djbdnscurve6 instead of djbdns.
Extract most of MESSAGE to README.pkgsrc.
Remove vestigial Red Hat chkconfig stanza from main control script (we
have pkgtools/rc.d-boot now).
Use CONF_FILES where applicable.
rc.d script defaults:
- Tag log entries like qmail-run's; for instance, "nbtinydns" and
"nbdnscache" become "nbdjbdns/tiny" and "nbdjbdns/cache".
- Have tinydns listen on the network.
- Auto-rebuild CDBs as needed on service start.
Bump version.
diffstat:
net/djbdns-run/DESCR | 4 +-
net/djbdns-run/INSTALL | 26 -----------------
net/djbdns-run/MESSAGE | 27 ++++-------------
net/djbdns-run/Makefile | 18 ++++++++----
net/djbdns-run/PLIST | 4 ++-
net/djbdns-run/files/README.pkgsrc | 23 +++++++++++++++
net/djbdns-run/files/axfrdns-tcp | 1 +
net/djbdns-run/files/axfrdns.sh | 55 ++++++++++++++++++++++---------------
net/djbdns-run/files/djbdns.sh | 15 ++-------
net/djbdns-run/files/dnscache.sh | 27 +++++++++--------
net/djbdns-run/files/rbldns.sh | 45 +++++++++++++++++++-----------
net/djbdns-run/files/tinydns.sh | 46 +++++++++++++++++++------------
net/djbdns-run/options.mk | 26 ++++++++++++++---
13 files changed, 176 insertions(+), 141 deletions(-)
diffs (truncated from 580 to 300 lines):
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/DESCR
--- a/net/djbdns-run/DESCR Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/DESCR Mon Jan 07 14:01:55 2019 +0000
@@ -1,2 +1,2 @@
-This package creates all the needed basic config files to run djbdns
-services, and provides NetBSD-style rc.d scripts.
+This package creates the config files and NetBSD-style rc.d scripts
+needed to run djbdns or djbdnscurve6.
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/INSTALL
--- a/net/djbdns-run/INSTALL Mon Jan 07 13:46:14 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-psmsg='#
-# This file was auto-generated by pkgsrc.'
-
-case ${STAGE} in
-
-POST-INSTALL)
-
- cd ${PKG_SYSCONFDIR}/axfrdns
- if ! [ -s tcp ]; then
- ${ECHO} ':allow,AXFR=""' > tcp
- ${ECHO} "$psmsg" >> tcp
- ${CHMOD} 644 tcp
- fi
- ${PREFIX}/bin/tcprules tcp.cdb tcp.tmp < tcp
- ${CHMOD} 644 tcp.cdb
-
- cd ${PKG_SYSCONFDIR}/dnscache
- ${TOUCH} ip/127.0.0.1
- ${CHMOD} 644 ip/127.0.0.1
- if ! [ -s servers/@ ]; then
- ${CP} ../dnsroots.global servers/@
- fi
-
- ;;
-
-esac
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/MESSAGE
--- a/net/djbdns-run/MESSAGE Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/MESSAGE Mon Jan 07 14:01:55 2019 +0000
@@ -1,26 +1,13 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.2 2005/01/26 07:01:10 schmonz Exp $
-
-Please read ${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
+$NetBSD: MESSAGE,v 1.3 2019/01/07 14:01:55 schmonz Exp $
-To enable a DNS...
-
-Cache for the local machine:
-- Set dnscache=YES in /etc/rc.conf.
-- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
+Assuming NetBSD-style rc(8), to enable a local DNS caching resolver:
-UDP name service:
-- Set tinydns=YES in /etc/rc.conf and tinydns_ip to a suitable IP address.
-- Create ${PKG_SYSCONFDIR}/tinydns/data with suitable contents.
-- Run "${RCD_SCRIPTS_DIR}/tinydns cdb".
+- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
+- Set dnscache=YES in /etc/rc.conf.
+- Run "${RCD_SCRIPTS_DIR}/dnscache start".
-TCP name service:
-- Enable UDP name service.
-- Set axfrdns=YES in /etc/rc.conf.
-
-RBL name service:
-- Set rbldns=YES in /etc/rc.conf and rbldns_ip to a suitable IP address.
-- Create ${PKG_SYSCONFDIR}/rbldns/data with suitable contents.
-- Run "${RCD_SCRIPTS_DIR}/rbldns cdb".
+For authoritative name service, RBL service, and more, please read
+${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
===========================================================================
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/Makefile
--- a/net/djbdns-run/Makefile Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/Makefile Mon Jan 07 14:01:55 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.30 2018/07/29 23:59:26 schmonz Exp $
+# $NetBSD: Makefile,v 1.31 2019/01/07 14:01:55 schmonz Exp $
#
-DISTNAME= djbdns-run-20180730
+DISTNAME= djbdns-run-20190107
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
@@ -10,7 +10,6 @@
COMMENT= Configures djbdns to cache and serve queries
LICENSE= 2-clause-bsd
-DEPENDS_DJBDNS= djbdns>=1.05nb5:../../net/djbdns
DEPENDS+= ${DEPENDS_DJBDNS}
DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
@@ -37,11 +36,18 @@
FILES_SUBST+= DJBDNS_TINY_USER=${DJBDNS_TINY_USER:Q}
FILES_SUBST+= PKGNAME=${PKGNAME:Q}
-INSTALLATION_DIRS= share/doc/djbdns-run
+INSTALLATION_DIRS= share/doc/djbdns-run share/examples/djbdns-run
BUILD_DEFS+= DJBDNS_AXFR_USER DJBDNS_CACHE_USER DJBDNS_LOG_USER
BUILD_DEFS+= DJBDNS_RBL_USER DJBDNS_TINY_USER
BUILD_DEFS+= DJBDNS_DJBDNS_GROUP
+CONF_FILES+= ${PKG_SYSCONFDIR}/dnsroots.global \
+ ${PKG_SYSCONFDIR}/dnscache/servers/@
+CONF_FILES+= ${PREFIX}/share/examples/djbdns-run/axfrdns-tcp \
+ ${PKG_SYSCONFDIR}/axfrdns/tcp
+
+.include "options.mk"
+
.include "../../mk/bsd.prefs.mk"
# Detect the PKG_SYSCONFDIR of the installed djbdns, so we can create
@@ -57,9 +63,9 @@
. endif
.endif
-.include "options.mk"
-
do-install:
${INSTALL_DATA} ${FILESDIR}/README.pkgsrc ${DESTDIR}${PREFIX}/share/doc/djbdns-run
+ ${INSTALL_DATA} ${FILESDIR}/axfrdns-tcp ${DESTDIR}${PREFIX}/share/examples/djbdns-run
+ ${INSTALL_DATA} ${FILESDIR}/dnscache-ip ${DESTDIR}${PREFIX}/share/examples/djbdns-run
.include "../../mk/bsd.pkg.mk"
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/PLIST
--- a/net/djbdns-run/PLIST Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/PLIST Mon Jan 07 14:01:55 2019 +0000
@@ -1,2 +1,4 @@
-@comment $NetBSD: PLIST,v 1.6 2014/03/11 14:05:07 jperkin Exp $
+@comment $NetBSD: PLIST,v 1.7 2019/01/07 14:01:55 schmonz Exp $
share/doc/djbdns-run/README.pkgsrc
+share/examples/djbdns-run/axfrdns-tcp
+share/examples/djbdns-run/dnscache-ip
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/files/README.pkgsrc
--- a/net/djbdns-run/files/README.pkgsrc Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/files/README.pkgsrc Mon Jan 07 14:01:55 2019 +0000
@@ -1,3 +1,26 @@
+ Getting started
+ ===============
+
+Assuming NetBSD-style rc(8), to enable a DNS...
+
+Caching resolver for the local machine:
+- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
+- Set dnscache=YES in /etc/rc.conf.
+- Run "@RCD_SCRIPTS_DIR@/dnscache start".
+
+Authoritative name server:
+- Set tinydns=YES in /etc/rc.conf.
+- Create @PKG_SYSCONFDIR@/tinydns/data with suitable contents.
+- Run "@RCD_SCRIPTS_DIR@/tinydns start".
+- For TCP service (if needed), set axfrdns=YES in /etc/rc.conf
+ and run "@RCD_SCRIPTS_DIR@/axfrdns start".
+
+RBL name server:
+- Set rbldns=YES in /etc/rc.conf (and rbldns_ip to a suitable IP address).
+- Create @PKG_SYSCONFDIR@/rbldns/data with suitable contents.
+- Run "@RCD_SCRIPTS_DIR@/rbldns start".
+
+
Getting help
============
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/files/axfrdns-tcp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/axfrdns-tcp Mon Jan 07 14:01:55 2019 +0000
@@ -0,0 +1,1 @@
+:allow,AXFR=""
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/files/axfrdns.sh
--- a/net/djbdns-run/files/axfrdns.sh Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/files/axfrdns.sh Mon Jan 07 14:01:55 2019 +0000
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: axfrdns.sh,v 1.9 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: axfrdns.sh,v 1.10 2019/01/07 14:01:55 schmonz Exp $
#
# @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service).
#
@@ -13,13 +13,16 @@
# User-settable rc.conf variables and their default values:
: ${axfrdns_postenv:=""}
-: ${axfrdns_tcpflags:="-vDRHl0"}
-: ${axfrdns_tcpport:="53"}
+: ${tinydns_ip:="@TINYDNS_LISTENIP@"}
: ${axfrdns_datalimit:="300000"}
: ${axfrdns_pretcpserver:=""}
: ${axfrdns_tcpserver:="@PREFIX@/bin/tcpserver"}
+: ${axfrdns_tcpflags:="-vDRHl0"}
+: ${axfrdns_tcprules:="@PKG_SYSCONFDIR@/axfrdns/tcp"}
+: ${axfrdns_autocdb:="YES"}
+: ${axfrdns_tcpport:="53"}
: ${axfrdns_log:="YES"}
-: ${axfrdns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${axfrdns_logcmd:="logger -t nbdjbdns/axfr -p daemon.info"}
: ${axfrdns_nologcmd:="@PREFIX@/bin/multilog -*"}
if [ -f /etc/rc.subr ]; then
@@ -27,7 +30,7 @@
fi
rcvar=${name}
-required_files="@PKG_SYSCONFDIR@/${name}/tcp.cdb"
+required_files="${axfrdns_tcprules}"
command="${axfrdns_tcpserver}"
procname=nb${name}
start_precmd="axfrdns_precmd"
@@ -35,34 +38,42 @@
cdb_cmd="axfrdns_cdb"
reload_cmd=${cdb_cmd}
-axfrdns_precmd()
-{
+axfrdns_precmd() {
if [ -f /etc/rc.subr ] && ! checkyesno axfrdns_log; then
axfrdns_logcmd=${axfrdns_nologcmd}
fi
+ if [ -f /etc/rc.subr ] && checkyesno axfrdns_autocdb; then
+ axfrdns_needcdb && axfrdns_cdb
+ fi
# tcpserver(1) is akin to inetd(8), but runs one service per process.
# We want to signal only the tcpserver process responsible for this
# service. Use argv0(1) to set procname to "axfrdns".
- command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv}
-ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip}
-@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@
-@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver}
-@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname}
-${axfrdns_tcpflags} -x @PKG_SYSCONFDIR@/${name}/tcp.cdb
--- ${tinydns_ip} ${axfrdns_tcpport}
-@PREFIX@/bin/${name}
-</dev/null 2>&1 |
+ command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv} \
+ROOT=@PKG_SYSCONFDIR@/tinydns \
+IP=${tinydns_ip} \
+@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@ \
+@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver} \
+@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname} \
+${axfrdns_tcpflags} -x ${axfrdns_tcprules}.cdb \
+-- \
+${tinydns_ip} ${axfrdns_tcpport} \
+@PREFIX@/bin/${name} \
+</dev/null 2>&1 | \
@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${axfrdns_logcmd}"
command_args="&"
rc_flags=""
}
-axfrdns_cdb()
-{
- @ECHO@ "Reloading @PKG_SYSCONFDIR@/axfrdns/tcp."
- cd @PKG_SYSCONFDIR@/${name}
- @PREFIX@/bin/tcprules tcp.cdb tcp.tmp < tcp
- @CHMOD@ 644 tcp.cdb
+axfrdns_needcdb() {
+ _src=${axfrdns_tcprules}
+ _dst=${axfrdns_tcprules}.cdb
+ [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
+}
+
+axfrdns_cdb() {
+ @ECHO@ "Reloading ${axfrdns_tcprules}."
+ @PREFIX@/bin/tcprules ${axfrdns_tcprules}.cdb ${axfrdns_tcprules}.tmp < ${axfrdns_tcprules}
+ @CHMOD@ 644 ${axfrdns_tcprules}.cdb
}
if [ -f /etc/rc.subr ]; then
diff -r ff7731b0627c -r 52164c91e40c net/djbdns-run/files/djbdns.sh
--- a/net/djbdns-run/files/djbdns.sh Mon Jan 07 13:46:14 2019 +0000
+++ b/net/djbdns-run/files/djbdns.sh Mon Jan 07 14:01:55 2019 +0000
@@ -1,14 +1,10 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: djbdns.sh,v 1.2 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: djbdns.sh,v 1.3 2019/01/07 14:01:55 schmonz Exp $
#
# @PKGNAME@ master script for administrators to control djbdns
# services.
#
-# For Red Hat chkconfig
-# chkconfig: - 55 45
-# description: DJB's collection of DNS tools
-#
# KEYWORD: nostart
@@ -20,13 +16,11 @@
# NOTE: run_rc_command sets $rc_arg
#
-forward_commands()
-{
+forward_commands() {
djbdnsrcd $COMMAND_LIST
}
Home |
Main Index |
Thread Index |
Old Index