pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/djbdns-run Initial import of djbdns-run, a package...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3d0033a4db77
branches:  trunk
changeset: 480211:3d0033a4db77
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Sep 01 20:13:04 2004 +0000

description:
Initial import of djbdns-run, a package that provides NetBSD-style
rc.d scripts (inspired by Bennett Todd's Linux init.d scripts) to
run djbdns services. It also includes Jonathan de Boyne Pollard's
dnscache-showctl and tinydns-showctl scripts.

diffstat:

 net/djbdns-run/DESCR                     |   3 +
 net/djbdns-run/INSTALL                   |  26 ++++++++++++
 net/djbdns-run/MESSAGE                   |  22 ++++++++++
 net/djbdns-run/Makefile                  |  68 ++++++++++++++++++++++++++++++++
 net/djbdns-run/PLIST                     |   5 ++
 net/djbdns-run/files/README.pkgsrc       |  11 +++++
 net/djbdns-run/files/axfrdns.sh          |  51 ++++++++++++++++++++++++
 net/djbdns-run/files/dnscache-showctl.sh |  20 +++++++++
 net/djbdns-run/files/dnscache.sh         |  44 ++++++++++++++++++++
 net/djbdns-run/files/tinydns-showctl.sh  |  17 ++++++++
 net/djbdns-run/files/tinydns.sh          |  50 +++++++++++++++++++++++
 11 files changed, 317 insertions(+), 0 deletions(-)

diffs (truncated from 361 to 300 lines):

diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/DESCR      Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,3 @@
+This package creates all the needed basic config files to run djbdns
+services, and provides NetBSD-style rc.d scripts. It also includes
+Jonathan de Boyne Pollard's dnscache-showctl and tinydns-showctl.
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/INSTALL    Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,26 @@
+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
+       ${LOCALBASE}/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 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/MESSAGE    Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,22 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+
+Please read ${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
+
+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".
+
+UDP name service:
+- Set tinydns=YES in /etc/rc.conf.
+- Set tinydns_ip to a suitable IP address of the local machine.
+- Create ${PKG_SYSCONFDIR}/tinydns/data with suitable contents.
+- Run "${RCD_SCRIPTS_DIR}/tinydns cdb".
+
+TCP name service:
+- Enable UDP name service.
+- Set axfrdns=YES in /etc/rc.conf.
+
+===========================================================================
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/Makefile   Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,68 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+#
+
+DISTNAME=              djbdns-run-20040901
+CATEGORIES=            net
+MASTER_SITES=          # empty
+DISTFILES=             # empty
+
+MAINTAINER=            schmonz%NetBSD.org@localhost
+COMMENT=               Configures djbdns to cache and serve queries
+
+DEPENDS_DJBDNS=                djbdns>=1.05nb5:../../net/djbdns
+DEPENDS+=              ${DEPENDS_DJBDNS}
+DEPENDS+=              daemontools-[0-9]*:../../sysutils/daemontools
+DEPENDS+=              ucspi-tcp-[0-9]*:../../net/ucspi-tcp
+
+CONFLICTS+=            djbdns<=1.05nb4
+
+PKG_INSTALLATION_TYPES=        overwrite pkgviews
+
+WRKSRC=                        ${WRKDIR}
+NO_CHECKSUM=           # defined
+
+USE_PKGINSTALL=                yes
+INSTALL_EXTRA_TMPL+=   ${PKGDIR}/INSTALL
+MAKE_DIRS+=            ${PKG_SYSCONFDIR}/axfrdns
+MAKE_DIRS+=            ${PKG_SYSCONFDIR}/dnscache/ip
+MAKE_DIRS+=            ${PKG_SYSCONFDIR}/dnscache/servers
+MAKE_DIRS+=            ${PKG_SYSCONFDIR}/tinydns
+PKG_GROUPS=            djbdns
+PKG_USERS+=            Gdnslog:djbdns::dnslog
+PKG_USERS+=            Gaxfrdns:djbdns::axfrdns
+PKG_USERS+=            Gdnscache:djbdns::dnscache
+PKG_USERS+=            Gtinydns:djbdns::tinydns
+RCD_SCRIPTS=           axfrdns dnscache tinydns
+FILES_SUBST+=          PKGNAME=${PKGNAME}
+
+INSTALLATION_DIRS=     bin share/doc/djbdns-run
+
+.include "../../mk/bsd.prefs.mk"
+
+# Detect the PKG_SYSCONFDIR of the installed djbdns, so we can create
+# config files there and refer to them from rc.d scripts.
+.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
+INSTALLED_DJBDNS!= ${PKG_BEST_EXISTS} ${DEPENDS_DJBDNS:C/:.*$//:Q:S/\ / /g}
+.  if empty(INSTALLED_DJBDNS:M*_not_found_)
+.    if !defined(PKG_SYSCONFDIR.djbdns-run)
+PKG_SYSCONFDIR.djbdns-run!= \
+       ${PKG_INFO} -qB ${INSTALLED_DJBDNS} |                           \
+               ${SED} -n '/^PKG_SYSCONFDIR=/s|^PKG_SYSCONFDIR=[        ]*||p'
+.    endif
+.  endif
+.endif
+
+do-build:
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/README.pkgsrc            \
+               > ${WRKDIR}/README.pkgsrc
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/dnscache-showctl.sh      \
+               > ${WRKDIR}/dnscache-showctl
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/tinydns-showctl.sh       \
+               > ${WRKDIR}/tinydns-showctl
+
+do-install:
+       ${INSTALL_SCRIPT} ${WRKDIR}/dnscache-showctl ${PREFIX}/bin
+       ${INSTALL_SCRIPT} ${WRKDIR}/tinydns-showctl ${PREFIX}/bin
+       ${INSTALL_DATA} ${WRKDIR}/README.pkgsrc ${PREFIX}/share/doc/djbdns-run
+
+.include "../../mk/bsd.pkg.mk"
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/PLIST      Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+bin/dnscache-showctl
+bin/tinydns-showctl
+share/doc/djbdns-run/README.pkgsrc
+@dirrm share/doc/djbdns-run
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/files/README.pkgsrc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/README.pkgsrc        Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,11 @@
+ Getting help
+ ============
+
+You've installed an automated and customized djbdns-run package.
+If you're having trouble getting the djbdns daemons to run, ask
+the package's maintainer:
+
+<URL:mailto:schmonz-nbdjbdns%schmonz.com@localhost>
+
+If you need to ask for help on the dns list, please mention that
+you're using the djbdns-run package from pkgsrc.
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/files/axfrdns.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/axfrdns.sh   Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,51 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: axfrdns.sh,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+#
+# @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service)
+#
+
+# PROVIDE: axfrdns named
+# REQUIRE: SERVERS tinydns
+# BEFORE:  DAEMON
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+name="axfrdns"
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/axfrdns/tcp.cdb"
+command="@LOCALBASE@/bin/tcpserver"
+procname=${name}
+start_precmd="axfrdns_precmd"
+extra_commands="cdb"
+cdb_cmd="axfrdns_cdb"
+
+# User-settable rc.conf variables and their default values:
+axfrdns_tcpflags=${axfrdns_tcpflags-"-vDRHl0"}
+axfrdns_datalimit=${axfrdns_datalimit-"300000"}
+axfrdns_logcmd=${axfrdns_logcmd-"@LOCALBASE@/bin/setuidgid Gdnslog logger -t nb${name} -p daemon.info"}
+
+axfrdns_precmd()
+{
+       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip} @LOCALBASE@/bin/envuidgid Gaxfrdns @LOCALBASE@/bin/softlimit -d ${axfrdns_datalimit} @LOCALBASE@/bin/argv0 
@LOCALBASE@/bin/tcpserver ${name} ${axfrdns_tcpflags} -x @PKG_SYSCONFDIR@/axfrdns/tcp.cdb -- ${tinydns_ip} 53 @LOCALBASE@/bin/axfrdns </dev/null 2>&1 | ${axfrdns_logcmd}"
+       command_args="&"
+       rc_flags=""
+}
+
+axfrdns_cdb()
+{
+       @ECHO@ "Reloading @PKG_SYSCONFDIR@/axfrdns/tcp."
+       cd @PKG_SYSCONFDIR@/axfrdns
+       @LOCALBASE@/bin/tcprules tcp.cdb tcp.tmp < tcp
+}
+
+if [ -f /etc/rc.subr ]; then
+       load_rc_config $name
+       run_rc_command "$1"
+else
+       @ECHO_N@ " ${name}"
+       axfrdns_precmd
+       eval ${command} ${axfrdns_flags} ${command_args}
+fi
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/files/dnscache-showctl.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/dnscache-showctl.sh  Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,20 @@
+#!@SH@
+# (c) Copyright 2001-2002 Jonathan de Boyne Pollard. All rights reserved. "Moral" rights asserted.
+# Permission is hereby granted to distribute this script unmodified.
+for i do (
+       cd "$i"
+       echo "$i" | sed -e 's/./*/g'
+       echo "$i"
+       echo "$i" | sed -e 's/./*/g'
+       echo
+       echo '+++ Configuration options:'
+       egrep '[A-Za-z0-9_]+=' run
+       ( cd env 2>/dev/null && grep "^" /dev/null * )
+       echo
+       echo '+++ Authorised client IP address prefixes:'
+       ls -1 root/ip
+       echo
+       echo '+++ Hardwired content server IP addresses:'
+       cd root/servers && grep "^" /dev/null *
+       echo
+); done
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/files/dnscache.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/dnscache.sh  Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,44 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: dnscache.sh,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+#
+# @PKGNAME@ script to control dnscache (caching DNS resolver)
+#
+
+# PROVIDE: dnscache named
+# REQUIRE: SERVERS
+# BEFORE:  DAEMON
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+name="dnscache"
+rcvar=${name}
+required_dirs="@PKG_SYSCONFDIR@/dnscache/ip @PKG_SYSCONFDIR@/dnscache/servers"
+required_files="@PKG_SYSCONFDIR@/dnscache/servers/@"
+command="@LOCALBASE@/bin/${name}"
+start_precmd="dnscache_precmd"
+
+# User-settable rc.conf variables and their default values:
+dnscache_ip=${dnscache_ip-"127.0.0.1"}
+dnscache_ipsend=${dnscache_ipsend-"0.0.0.0"}
+dnscache_size=${dnscache_size-"1000000"}
+dnscache_datalimit=${dnscache_datalimit-"3000000"}
+dnscache_logcmd=${dnscache_logcmd-"@LOCALBASE@/bin/setuidgid Gdnslog logger -t nb${name} -p daemon.info"}
+
+dnscache_precmd()
+{
+       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/dnscache IP=${dnscache_ip} IPSEND=${dnscache_ipsend} CACHESIZE=${dnscache_size} @LOCALBASE@/bin/envuidgid Gdnscache @LOCALBASE@/bin/softlimit -o250 
-d ${dnscache_datalimit} @LOCALBASE@/bin/dnscache </dev/random 2>&1 | ${dnscache_logcmd}"
+       command_args="&"
+       rc_flags=""
+}
+
+if [ -f /etc/rc.subr ]; then
+       load_rc_config $name
+       run_rc_command "$1"
+else
+       @ECHO_N@ " ${name}"
+       dnscache_precmd
+       eval ${command} ${dnscache_flags} ${command_args}
+fi
diff -r 55a2e1e4b014 -r 3d0033a4db77 net/djbdns-run/files/tinydns-showctl.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/tinydns-showctl.sh   Wed Sep 01 20:13:04 2004 +0000
@@ -0,0 +1,17 @@
+#!@SH@
+# (c) Copyright 2001-2002 Jonathan de Boyne Pollard. All rights reserved. "Moral" rights asserted.
+# Permission is hereby granted to distribute this script unmodified.
+for i do (
+       cd "$i"
+       echo "$i" | sed -e 's/./*/g'
+       echo "$i"
+       echo "$i" | sed -e 's/./*/g'
+       echo
+       echo '+++ Configuration options:'



Home | Main Index | Thread Index | Old Index