diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-09 15:39:08 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-09 15:39:08 +0000 |
commit | 4a1e5651ddb2eb4d0926c0aa1099e152610efd5f (patch) | |
tree | 74d9a54beef716ae62e68dfef876ca4bdc2d0d50 /net-dns/pdnsd | |
parent | Fix building with libpng14. (diff) | |
download | gentoo-2-4a1e5651ddb2eb4d0926c0aa1099e152610efd5f.tar.gz gentoo-2-4a1e5651ddb2eb4d0926c0aa1099e152610efd5f.tar.bz2 gentoo-2-4a1e5651ddb2eb4d0926c0aa1099e152610efd5f.zip |
Version bump, with a few changes: init script is no longer totally quiet (you'd miss on the errors) and will create the cache directory if missing; the configuration file for pdnsd does no longer contain the whole help text (saves from etc-update and fixes cross-compilation); the test function should work even if no network is available (and will no longer happen “automagically”, as it depends on dig being present now); ipv6 is enabled automatically on the build rather than by parameter, with the USE flag set; drop underscores USE flag (obsoleted, upstream no longer supports it), enable urandom by default (avoids sapping entropy by default, most users will be comfortable with that default); drop nptl USE flag (leave it to be auto-configured, which is good). To do for the next revision: install the dhcp2pdnsd script properly, and write an init script for that.
(Portage version: 2.2_rc66/cvs/Linux x86_64)
Diffstat (limited to 'net-dns/pdnsd')
-rw-r--r-- | net-dns/pdnsd/ChangeLog | 22 | ||||
-rw-r--r-- | net-dns/pdnsd/files/pdnsd.rc6.1 | 44 | ||||
-rw-r--r-- | net-dns/pdnsd/pdnsd-1.2.8.ebuild | 119 |
3 files changed, 183 insertions, 2 deletions
diff --git a/net-dns/pdnsd/ChangeLog b/net-dns/pdnsd/ChangeLog index e1528f8909d1..716c065aadf0 100644 --- a/net-dns/pdnsd/ChangeLog +++ b/net-dns/pdnsd/ChangeLog @@ -1,6 +1,24 @@ # ChangeLog for net-dns/pdnsd -# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.91 2009/05/09 13:06:11 mrness Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.92 2010/03/09 15:39:06 flameeyes Exp $ + +*pdnsd-1.2.8 (09 Mar 2010) + + 09 Mar 2010; Diego E. Pettenò <flameeyes@gentoo.org> +pdnsd-1.2.8.ebuild, + +files/pdnsd.rc6.1: + Version bump, with a few changes: init script is no longer totally quiet + (you'd miss on the errors) and will create the cache directory if missing; + the configuration file for pdnsd does no longer contain the whole help + text (saves from etc-update and fixes cross-compilation); the test + function should work even if no network is available (and will no longer + happen “automagically”, as it depends on dig being present now); ipv6 + is enabled automatically on the build rather than by parameter, with the + USE flag set; drop underscores USE flag (obsoleted, upstream no longer + supports it), enable urandom by default (avoids sapping entropy by + default, most users will be comfortable with that default); drop nptl USE + flag (leave it to be auto-configured, which is good). To do for the next + revision: install the dhcp2pdnsd script properly, and write an init script + for that. 09 May 2009; Alin Năstac <mrness@gentoo.org> -files/pdnsd.resolvconf, -pdnsd-1.2.6.ebuild, -pdnsd-1.2.6-r1.ebuild, pdnsd-1.2.7-r1.ebuild: diff --git a/net-dns/pdnsd/files/pdnsd.rc6.1 b/net-dns/pdnsd/files/pdnsd.rc6.1 new file mode 100644 index 000000000000..1c53664182e6 --- /dev/null +++ b/net-dns/pdnsd/files/pdnsd.rc6.1 @@ -0,0 +1,44 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/files/pdnsd.rc6.1,v 1.1 2010/03/09 15:39:08 flameeyes Exp $ + +opts="reload" + +depend() { + need net + provide dns +} + +checkconfig() { + if [ ! -e /etc/pdnsd/pdnsd.conf ] ; then + eerror "You need an /etc/pdnsd/pdnsd.conf file first." + eerror "There is a sample in /etc/pdnsd/pdnsd.conf.sample" + return 1 + fi + + if [ ! -d /var/cache/pdnsd ] ; then + mkdir /var/cache/pdnsd + chown pdnsd:pdnsd /var/cache/pdnsd + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting pdnsd" + start-stop-daemon --start --exec /usr/sbin/pdnsd \ + -- -s -t -d -p /var/run/pdnsd.pid ${PDNSDCONFIG} + eend $? +} + +stop() { + ebegin "Stopping pdnsd" + start-stop-daemon --stop --pidfile /var/run/pdnsd.pid + eend $? +} + +reload() { + ebegin "Reloading pdnsd.conf" + /usr/sbin/pdnsd-ctl config + eend $? +} diff --git a/net-dns/pdnsd/pdnsd-1.2.8.ebuild b/net-dns/pdnsd/pdnsd-1.2.8.ebuild new file mode 100644 index 000000000000..05f521802da0 --- /dev/null +++ b/net-dns/pdnsd/pdnsd-1.2.8.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.8.ebuild,v 1.1 2010/03/09 15:39:06 flameeyes Exp $ + +EAPI="2" + +inherit eutils + +DESCRIPTION="Proxy DNS server with permanent caching" +HOMEPAGE="http://www.phys.uu.nl/~rombouts/pdnsd.html" +SRC_URI="http://www.phys.uu.nl/~rombouts/pdnsd/releases/${P}-par.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~s390 ~sparc ~x86" +IUSE="debug ipv6 isdn +urandom test" + +RDEPEND="" +DEPEND="test? ( net-dns/bind-tools )" + +pkg_setup() { + enewgroup pdnsd + enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd +} + +src_configure() { + local myconf="" + use debug && myconf="${myconf} --with-debug=3" + use urandom && myconf="${myconf} --with-random-device=/dev/urandom" + + econf \ + --disable-dependency-tracking \ + --sysconfdir=/etc/pdnsd \ + --with-cachedir=/var/cache/pdnsd \ + --with-default-id=pdnsd \ + $(use_enable ipv6) $(use_enable ipv6 ipv6-startup) \ + $(use_enable isdn) \ + ${myconf} \ + || die "bad configure" +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + + dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par || die + docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl} || die + docinto html ; dohtml doc/html/* || die + docinto txt ; dodoc doc/txt/* || die + newdoc doc/pdnsd.conf pdnsd.conf.sample || die + + newinitd "${FILESDIR}/pdnsd.rc6.1" pdnsd || die + newinitd "${FILESDIR}/pdnsd.online" pdnsd-online || die + + mkdir "${T}"/confd + + cat - > "${T}"/confd/pdnsd-online <<EOF +# Enter the interface that connects you to the dns servers +# This will correspond to /etc/init.d/net.\${IFACE} +# +# IMPORTANT: Be sure to run depscan.sh after modifiying the +# IFACE variable +IFACE=ppp0 +EOF + + # Don't try to do the smart thing and add the --help output here: + # it will cause the file to be etc-updated if the help text + # changes and fails when cross-compiling. + cat - > "${T}"/confd/pdnsd <<EOF +# Command line options, check pdnsd --help for a list of valid +# parameters. Note that most of the options that can be given at +# command-line are also available as configuration parameters in +# /etc/pdnsd/pdnsd.conf +PDNSDCONFIG="" +EOF + + doconfd "${T}"/confd/* || die + + # gentoo resolvconf support + exeinto /etc/resolvconf/update.d + newexe "${FILESDIR}/pdnsd.resolvconf-r1" pdnsd +} + +src_test() { + fail_kill() { + kill -9 $(<"${T}"/pid) + die "$1" + } + + mkdir "${T}/pdnsd" + echo -n -e "pd12\0\0\0\0" > "${T}/pdnsd/pdnsd.cache" + IPS=$(grep ^nameserver /etc/resolv.conf | sed -e 's/nameserver \(.*\)/\tip=\1;/g' | xargs) + sed -e "s/\tip=/${IPS}/" -e "s:cache_dir=:cache_dir=${T}/pdnsd:" "${FILESDIR}/pdnsd.conf.test" \ + > "${T}/pdnsd.conf.test" + src/pdnsd -c "${T}/pdnsd.conf.test" -g -s -d -p "${T}/pid" || die "couldn't start daemon" + sleep 3 + + find "${T}" -ls + [ -s "${T}/pid" ] || die "empty or no pid file created" + [ -S "${T}/pdnsd/pdnsd.status" ] || fail_kill "no socket created" + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || fail_kill "failed to start the daemon" + src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || fail_kill "failed to communicate with the daemon" + sleep 3 + + dig @127.0.0.1 -p 33455 localhost > "${T}"/dig.output 2>&1 + cat "${T}"/dig.output + fgrep -q "status: NOERROR" "${T}"/dig.output || fail_kill "www.gentoo.org lookup failed" + + kill $(<"${T}/pid") || fail_kill "failed to terminate daemon" +} + +pkg_postinst() { + elog + elog "Add pdnsd to your default runlevel - rc-update add pdnsd default" + elog "" + elog "Add pdnsd-online to your online runlevel." + elog "The online interface will be listed in /etc/conf.d/pdnsd-online" + elog "" + elog "Sample config file in /etc/pdnsd/pdnsd.conf.sample" +} |