summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2002-06-29 00:55:03 +0000
committerThilo Bangert <bangert@gentoo.org>2002-06-29 00:55:03 +0000
commit6fd1686d6b18a634b4c81211c4c7292986fb3f27 (patch)
tree2fe3b5fdb45b1b92faf53493b06c26d8d9b22116 /net-dns/djbdns
parentnew category: net-dns (diff)
downloadgentoo-2-6fd1686d6b18a634b4c81211c4c7292986fb3f27.tar.gz
gentoo-2-6fd1686d6b18a634b4c81211c4c7292986fb3f27.tar.bz2
gentoo-2-6fd1686d6b18a634b4c81211c4c7292986fb3f27.zip
new category: net-dns. initial import
Diffstat (limited to 'net-dns/djbdns')
-rw-r--r--net-dns/djbdns/ChangeLog32
-rw-r--r--net-dns/djbdns/djbdns-1.05-r2.ebuild56
-rw-r--r--net-dns/djbdns/files/digest-djbdns-1.05-r21
-rw-r--r--net-dns/djbdns/files/dnscache-setup239
-rw-r--r--net-dns/djbdns/files/tinydns-setup146
5 files changed, 474 insertions, 0 deletions
diff --git a/net-dns/djbdns/ChangeLog b/net-dns/djbdns/ChangeLog
new file mode 100644
index 000000000000..0cfae772a7e1
--- /dev/null
+++ b/net-dns/djbdns/ChangeLog
@@ -0,0 +1,32 @@
+# ChangeLog for net-dns/djbdns
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
+# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/ChangeLog,v 1.1 2002/06/29 00:55:03 bangert Exp $
+
+*djbdns-1.05-r2 (13 May 2002)
+
+ 12 May 2002; Thilo Bangert <bangert@gentoo.org> .ebuild :
+
+ added LICENSE, added setup scripts (by banger@gentoo.org and gontran@gontran.net)
+ removed old setup scripts
+
+ 7 May 2002; Thilo Bangert <bangert@gentoo.org> .ebuild :
+
+ added automatic creation of users
+
+
+*djbdns-1.05-r1 (1 Mar 2002)
+
+ 1 Mar 2002; Grant Goodyear <g2boojum@gentoo.org> ChangeLog :
+
+ Made ebuild a bit more modern and ditched init script since that's
+ what daemontools is for.
+
+*djbdns-1.05 (1 Feb 2002)
+
+ 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog :
+
+ Added initial ChangeLog which should be updated whenever the package is
+ updated in any way. This changelog is targetted to users. This means that the
+ comments should well explained and written in clean English. The details about
+ writing correct changelogs are explained in the skel.ChangeLog file which you
+ can find in the root directory of the portage repository.
diff --git a/net-dns/djbdns/djbdns-1.05-r2.ebuild b/net-dns/djbdns/djbdns-1.05-r2.ebuild
new file mode 100644
index 000000000000..803745422bfe
--- /dev/null
+++ b/net-dns/djbdns/djbdns-1.05-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2001 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Achim Gottinger <achim@gentoo.org>
+# Maintainer Thilo Bangert <bangert@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/djbdns-1.05-r2.ebuild,v 1.1 2002/06/29 00:55:03 bangert Exp $
+
+S=${WORKDIR}/${P}
+DESCRIPTION="Excellent high-performance DNS services"
+SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz"
+HOMEPAGE="http://cr.yp.to/djbdns.html"
+
+LICENSE="as-is"
+
+DEPEND="virtual/glibc"
+RDEPEND=">=sys-apps/daemontools-0.70
+ sys-apps/ucspi-tcp"
+
+src_compile() {
+ echo "gcc ${CFLAGS}" > conf-cc
+ echo "gcc" > conf-ld
+ echo "/usr" > conf-home
+ emake || die "emake failed"
+}
+
+src_install() {
+ insinto /etc
+ doins dnsroots.global
+ into /usr
+ for i in *-conf dnscache tinydns walldns rbldns pickdns axfrdns *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
+ do
+ dobin $i
+ done
+ dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
+
+ dobin ${FILESDIR}/dnscache-setup
+ dobin ${FILESDIR}/tinydns-setup
+
+}
+
+pkg_postinst() {
+ groupadd nofiles
+ id dnscache || useradd -g nofiles -d /nonexistent -s /bin/false dnscache
+ id dnslog || useradd -g nofiles -d /nonexistent -s /bin/false dnslog
+ id tinydns || useradd -g nofiles -d /nonexistent -s /bin/false tinydns
+
+ echo
+ einfo "Use dnscache-setup and tinydns-setup to help you configure your nameservers!"
+ echo
+}
+
+pkg_postrm() {
+ userdel dnscache
+ userdel dnslog
+ userdel tinydns
+}
+
diff --git a/net-dns/djbdns/files/digest-djbdns-1.05-r2 b/net-dns/djbdns/files/digest-djbdns-1.05-r2
new file mode 100644
index 000000000000..7f303eca6ac3
--- /dev/null
+++ b/net-dns/djbdns/files/digest-djbdns-1.05-r2
@@ -0,0 +1 @@
+MD5 3147c5cd56832aa3b41955c7a51cbeb2 djbdns-1.05.tar.gz 85648
diff --git a/net-dns/djbdns/files/dnscache-setup b/net-dns/djbdns/files/dnscache-setup
new file mode 100644
index 000000000000..b9795c36923a
--- /dev/null
+++ b/net-dns/djbdns/files/dnscache-setup
@@ -0,0 +1,239 @@
+#!/bin/bash
+
+#for einfo, ewarn etc..
+. /sbin/functions.sh
+
+setup() {
+ echo
+ echo
+ einfo "Dnscache Setup"
+ echo
+ echo
+ echo ">>> More information on this package can be found at"
+ echo ">>> http://cr.yp.to/djbdns.html and http://djbdns.org"
+ echo
+ echo "After this script completes, dnscache will be configured."
+ echo "Your /etc/resolv.conf will be updated so that all DNS"
+ echo "lookups will be directed to dnscache."
+ echo
+ echo "Your original /etc/resolv.conf will be backed up to "
+ echo "/etc/resolv.conf.orig."
+ echo
+ echo "If you have previously setup dnscache, those directories will"
+ echo "not be overwritten. To redo setup, delete your dnscache"
+ echo "dirs first or choose a different install location."
+ echo
+ echo '(press enter to begin setup, or press control-C to abort)'
+ echo
+ read
+
+ echo
+ einfo "Install location"
+ echo
+ echo "Where do you want dnscache installed?"
+ echo "Ex. Default (/var) will install dnscache in /var/dnscache,"
+ echo "or an external cache in /var/dnscachex."
+ echo "!!No trailing slash!!"
+ echo
+ read -p "[/var]> " mypath
+ echo
+
+ if [ "$mypath" == "" ]
+ then
+ mypath="/var"
+ fi
+
+ if [ ! -e ${mypath} ]
+ then
+ echo ">>> Creating ${mypath}..."
+ mkdir $mypath
+ fi
+
+ echo
+ echo
+ einfo "Internal or external cache?"
+ echo
+ echo "Specify an address to which dnscache should bind."
+ echo "If this is the only machine accessing dnscache,"
+ echo "127.0.0.1 is a good start."
+ echo "Currently running IP addresses:"
+ echo
+
+ # grab interfaces
+ addrs=`ifconfig -a | grep "inet addr" | cut -f2 -d":" | cut -f1 -d" "`
+
+ echo $addrs
+ echo
+ read -p "IP to bind cache to [127.0.0.1]> " myip
+ echo
+
+ if [ "$myip" == "" ]
+ then
+ myip="127.0.0.1"
+ mycachedir="dnscache"
+ else
+ mycachedir="dnscachex"
+ fi
+
+ # check for existance of users dnscache and dnslog:
+ echo
+ echo
+ einfo "Checking for dnscache and dnslog user accts ..."
+ echo
+ /usr/bin/grep nofiles /etc/group &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding group nofiles ..."
+ /usr/sbin/groupadd nofiles &> /dev/null
+ fi
+
+ /usr/bin/grep dnscache /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnscache ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnscache &> /dev/null
+ fi
+
+ /usr/bin/grep dnslog /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnslog ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnslog &> /dev/null
+ fi
+
+ if [ ! -e ${mypath}/${mycachedir} ]
+ then
+ /usr/bin/dnscache-conf dnscache dnslog \
+ ${mypath}/${mycachedir} ${myip}
+ else
+ ewarn "*** dnscache directory currently exists, nothing done."
+ fi
+
+ echo
+ echo
+ einfo "Configure a forward for dnscache?"
+ echo
+ echo "dnscache can be configured to forward queries to another"
+ echo "nameserver (such as the nameserver of your ISP) rather than "
+ echo "perform the lookups itself. If you would like to enable this "
+ echo "forwarding mode (a good idea most of the time), then enter the "
+ echo "IP's of your forwarding nameservers now,"
+ echo "otherwise just hit Enter."
+ echo
+ read -p "enter forward-to IP> " myforward
+ echo
+ if [ "$myforward" != "" ]
+ then
+ echo $myforward > ${mypath}/${mycachedir}/root/servers/\@
+ echo -n "1" > ${mypath}/${mycachedir}/env/FOWARDONLY
+
+ read -p "enter forward-to IP [hit Enter to stop]> " myforward
+ while [ "$myforward" != "" ]
+ do
+ echo $myforward >> ${mypath}/${mycachedir}/root/servers/\@
+ read -p "enter forward-to IP [hit Enter to stop]> " myforward
+ done
+ echo ">>> Setting up forwarding..."
+ fi
+
+ if [ "$myip" != "127.0.0.1" ]
+ then
+ echo
+ echo
+ einfo "Configuring clients"
+ echo
+ echo "dnscache by default only allows 127.0.0.1 to access it."
+ echo "You have to specify the IP addresses of the clients"
+ echo "that shall be allowed to use dnscache."
+ echo
+ echo "1.2.3.4 would allow host 1.2.3.4"
+ echo "1.2.3 would allow all hosts underneath 1.2.3.x"
+ echo
+ echo "Just hit Enter if you do not want to specify clients!"
+ echo
+
+ read -p "Enter IP> " myclientip
+
+ while [ "$myclientip" != "" ]
+ do
+ touch ${mypath}/${mycachedir}/root/ip/${myclientip}
+ read -p "Enter IP (hit Enter to stop)>" myclientip
+ done
+ fi
+
+ echo
+ echo
+ einfo "Misc"
+ echo
+ if [ ! -e /var/log/dnscache ]
+ then
+ echo ">>> linking /var/log/${mycachedir} to the $mycachedir log..."
+ ln -s ${mypath}/${mycachedir}/log/main /var/log/${mycachedir}
+ fi
+
+ if [ -e /etc/resolv.conf ]
+ then
+ /usr/bin/grep $myip /etc/resolv.conf &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Backing up /etc/resolv.conf to resolv.conf.orig..."
+ cp /etc/resolv.conf /etc/resolv.conf.orig
+ cat /etc/resolv.conf.orig | grep -v nameserver > /etc/resolv.conf
+ echo ">>> Removed nameserver entries from resolv.conf..."
+ echo nameserver $myip >> /etc/resolv.conf
+ echo
+ echo ">>> Added \"nameserver ${myip}\" to /etc/resolv.conf!"
+ else
+ echo ">>> ${myip} is already in /etc/resolv.conf - nothing done!"
+ fi
+ else
+ echo nameserver $myip >> /etc/resolv.conf
+ echo
+ echo ">>> Added \"nameserver ${myip}\" to /etc/resolv.conf!"
+ fi
+
+ #TODO
+ #configure cachsize - $mypath/env/CACHESIZE
+
+ #TODO
+ #configure datalimit - $mypath/env/DATALIMIT
+
+ echo
+ echo
+ einfo "Start service"
+ echo
+ echo "dnscache is ready for startup."
+ echo "Do you want dnscache to be started and"
+ echo "supervised by daemontools now?"
+
+ echo
+ echo "This requires svscan (daemontools) to be running currently and"
+ echo "monitoring /service !!"
+ echo
+ echo '(press control-C to abort)'
+ read
+
+ # check in /mnt/.init.d to find svscan link in running...
+ # if not running execute /etc/init.d/svscan start
+
+ ln -sf ${mypath}/${mycachedir} /service/${mycachedir}
+
+ echo
+ echo
+ einfo "Installation successfull"
+ echo
+}
+
+# check for root user
+
+if [ `id -u` -ne 0 ]
+then
+ eerror "${0}: must be root."
+ exit 1
+fi
+
+
+# run setup
+setup
diff --git a/net-dns/djbdns/files/tinydns-setup b/net-dns/djbdns/files/tinydns-setup
new file mode 100644
index 000000000000..f12bfaaf39b7
--- /dev/null
+++ b/net-dns/djbdns/files/tinydns-setup
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+#
+# source functions.sh for einfo, eerror and ewarn
+. /sbin/functions.sh
+
+setup() {
+ echo
+ echo
+ einfo "tinydns Setup"
+ echo
+ echo ">>> More information on this package can be found at"
+ echo ">>> http://cr.yp.to/djbdns/tinydns.html"
+ echo
+ echo "If you have previously setup tinydns, those directories will"
+ echo "not be overwritten. To redo setup, delete your"
+ echo "tinydns dir tree first."
+ echo
+ echo '(press enter to begin setup, or press control-C to abort)'
+ echo
+ read
+
+ echo
+ einfo "Install location"
+ echo
+ echo "Where do you want tinydns installed?"
+ echo "Ex. /var would install dnscache in /var/tinydns."
+ echo "!!No trailing slash!!"
+ echo
+ read -p "[/var]> " mypath
+ echo
+
+ if [ "$mypath" == "" ]
+ then
+ mypath="/var"
+ fi
+
+ if [ ! -e ${mypath} ]
+ then
+ echo ">>> Creating ${mypath}..."
+ mkdir $mypath
+ fi
+
+ # check for existance of users dnscache and dnslog:
+ echo
+ echo
+ einfo "Checking for tinydns and dnslog user accts ..."
+ echo
+ /usr/bin/grep nofiles /etc/group &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding group nofiles ..."
+ /usr/sbin/groupadd nofiles &> /dev/null
+ fi
+
+ /usr/bin/grep tinydns /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnscache ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnscache &> /dev/null
+ fi
+
+ /usr/bin/grep dnslog /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnslog ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnslog &> /dev/null
+ fi
+
+
+ # grab interfaces
+ addrs=`ifconfig -a | grep "inet addr" | cut -f2 -d":" | cut -f1 -d" "`
+
+ echo "Specify an address to which tinydns should bind."
+ echo "NOTICE: tinydns must be able to bind to port 53 on "
+ echo "choosen ip address! udp by tinydns - tcp by axfrdns"
+ echo "Usually this is NOT 127.0.0.1"
+ echo "Currently running IP addresses:"
+ echo
+ echo $addrs
+ echo
+
+ while [ "$myip" = "" ]
+ do
+ read -p "IP to bind nameserver to>" myip
+ done
+ echo
+
+ if [ ! -e ${mypath}/tinydns ]
+ then
+ einfo "Setting up tinydns..."
+ /usr/bin/tinydns-conf tinydns dnslog \
+ ${mypath}/tinydns $myip
+ else
+ ewarn "*** tinydns directory currently exists, nothing done."
+ fi
+
+ #add afxrdns
+ if [ ! -e ${mypath}/axfrdns ]
+ then
+ einfo "Setting up axfrdns..."
+ /usr/bin/axfrdns-conf tinydns dnslog \
+ ${mypath}/axfrdns ${mypath}/tinydns $myip
+ else
+ ewarn "*** axfrdns directory currently exists, nothing done."
+ fi
+
+ #grant access to axfrdns
+
+ echo
+ echo
+ einfo "Start service"
+ echo
+ echo "tinydns is ready for startup."
+ echo "Do you want dnscache to be started and"
+ echo "supervised by daemontools now?"
+
+ echo
+ echo "This requires daemontools to supervise"
+ echo "/service !!"
+ echo
+ echo '(press control-C to abort)'
+ read
+
+ ln -sf ${mypath}/tinydns /service/
+ ln -sf ${mypath}/axfrdns /service/
+
+ echo
+ echo
+ einfo "Installation successfull"
+ echo
+
+}
+
+# check for root user!
+if [ `id -u` -ne 0 ]
+then
+ eerror "${0}: must be root."
+ exit 1
+fi
+
+
+# run setup
+setup