ChangeLog

# ChangeLog for net-dns/pdnsd
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.77 2008/04/20 05:07:38 mrness Exp $

*pdnsd-1.2.6-r1 (20 Apr 2008)

20 Apr 2008; Alin Năstac +files/pdnsd.resolvconf-r1,
-pdnsd-1.2.5-r1.ebuild, +pdnsd-1.2.6-r1.ebuild:
Make resolvconf script compatible with baselayout-2 (#218031).

14 Jan 2008; Christoph Mende pdnsd-1.2.6.ebuild:
Stable on amd64 wrt bug #203769

05 Jan 2008; nixnut pdnsd-1.2.6.ebuild:
Stable on ppc wrt bug 203769

31 Dec 2007; Raúl Porcel pdnsd-1.2.6.ebuild:
alpha/sparc/x86 stable wrt #203769, add ~ia64

*pdnsd-1.2.6 (05 Nov 2007)

05 Nov 2007; Alin Năstac pdnsd-1.2.5-r1.ebuild,
+pdnsd-1.2.6.ebuild:
Version bumped under new GPL-3 license. Add urandom USE flag.

*pdnsd-1.2.5-r1 (13 Jul 2007)

13 Jul 2007; Alin Năstac
-files/pdnsd-1.2.4-dbg_file.patch, files/pdnsd.rc6,
-pdnsd-1.2.4-r1.ebuild, -pdnsd-1.2.4-r3.ebuild, -pdnsd-1.2.5.ebuild,
+pdnsd-1.2.5-r1.ebuild:
Add reload option to pdnsd init script (#184871).

06 May 2007; Marius Mauch pdnsd-1.2.4-r1.ebuild,
pdnsd-1.2.4-r3.ebuild, pdnsd-1.2.5.ebuild:
Replacing einfo with elog

22 Apr 2007; Tobias Scherbaum pdnsd-1.2.5.ebuild:
ppc stable, bug #174559

22 Apr 2007; Bryan Østergaard pdnsd-1.2.5.ebuild:
Stable on Alpha, bug 174559.

10 Mar 2007; Alin Năstac pdnsd-1.2.4-r1.ebuild,
pdnsd-1.2.4-r3.ebuild, pdnsd-1.2.5.ebuild:
Remove references to $ROOT from src_* functions (#168039).

16 Jan 2007; Alin Năstac pdnsd-1.2.5.ebuild:
Stable on amd64.

20 Nov 2006; Gustavo Zacarias pdnsd-1.2.5.ebuild:
Stable on sparc

17 Nov 2006; Alin Nastac -pdnsd-1.2.4.ebuild,
pdnsd-1.2.5.ebuild:
Remove old version. Stable on x86.

24 Sep 2006; Michael Hanselmann pdnsd-1.2.4-r3.ebuild:
Stable on ppc.

21 Sep 2006; Gustavo Zacarias pdnsd-1.2.4-r3.ebuild:
Stable on sparc

*pdnsd-1.2.5 (21 Sep 2006)

21 Sep 2006; Alin Nastac pdnsd-1.2.4-r3.ebuild,
+pdnsd-1.2.5.ebuild:
Stable on x86. Add new version with a brand new USE flag (underscores).

*pdnsd-1.2.4-r3 (25 Jun 2006)

25 Jun 2006; Alin Nastac files/pdnsd.resolvconf,
-pdnsd-1.2.4-r2.ebuild, +pdnsd-1.2.4-r3.ebuild:
Update support for resolvconf-gentoo (#134254).

*pdnsd-1.2.4-r2 (11 Jun 2006)

11 Jun 2006; Alin Nastac +files/pdnsd.resolvconf,
-pdnsd-1.2.3.ebuild, +pdnsd-1.2.4-r2.ebuild:
Add support for resolvconf-gentoo, thanks to Oldrich Jedlicka
(#134254).

29 Apr 2006; Tobias Scherbaum
pdnsd-1.2.4-r1.ebuild:
ppc stable, bug #131341

27 Apr 2006; Gustavo Zacarias pdnsd-1.2.4-r1.ebuild:
Stable on sparc wrt security #131341

27 Apr 2006; pdnsd-1.2.4-r1.ebuild:
Stable on alpha and amd64 wrt security Bug #131341.

*pdnsd-1.2.4-r1 (27 Apr 2006)

27 Apr 2006; Alin Nastac
+files/pdnsd-1.2.4-dbg_file.patch, +pdnsd-1.2.4-r1.ebuild:
Fix segfault when build with debug USE flag enabled, thanks to Thomas Cort
. Submitted as stable on x86 wrt security bug #131341.

26 Apr 2006; pdnsd-1.2.4.ebuild:
Stable on amd64 wrt security Bug #131341.

26 Apr 2006; Alin Nastac pdnsd-1.2.4.ebuild:
Fix src_test by inserting yet another sleep (#131341).

13 Mar 2006; Gustavo Zacarias pdnsd-1.2.4.ebuild:
Stable on sparc

10 Mar 2006; Michael Hanselmann pdnsd-1.2.4.ebuild:
Stable on ppc.

08 Mar 2006; Alin Nastac metadata.xml,
-pdnsd-1.1.10.ebuild, -pdnsd-1.2.2.ebuild, pdnsd-1.2.4.ebuild:
Remove obsolete versions. Update package description. Sanitize the ebuild
code, mostly by quoting strings containing env vars. Mark as stable on x86.

07 Feb 2006; Simon Stelling pdnsd-1.2.3.ebuild:
stable on amd64

*pdnsd-1.2.4 (01 Feb 2006)

01 Feb 2006; Alin Nastac +pdnsd-1.2.4.ebuild:
Version bump (#121201), with clean dependencies - all previous dependencies
are in the system class.

15 Nov 2005; Gustavo Zacarias pdnsd-1.2.3.ebuild:
Stable on sparc - selftests fail miserably so disable them

18 Oct 2005; Aron Griffis pdnsd-1.2.3.ebuild:
Mark 1.2.3 stable on alpha

06 Oct 2005; Michael Hanselmann pdnsd-1.2.3.ebuild:
Stable on ppc.

04 Oct 2005; Alin Nastac pdnsd-1.1.10.ebuild,
pdnsd-1.2.2.ebuild, pdnsd-1.2.3.ebuild:
Remove COPYING* from docs. Mark stable on x86.

16 Sep 2005; Alin Nastac pdnsd-1.1.10.ebuild,
pdnsd-1.2.2.ebuild, pdnsd-1.2.3.ebuild:
Set enewuser's shell argument to -1 in pkg_preinst (#103421).

*pdnsd-1.2.3 (08 Sep 2005)

08 Sep 2005; Alin Nastac pdnsd-1.1.10.ebuild,
pdnsd-1.2.2.ebuild, +pdnsd-1.2.3.ebuild:
Set enewuser's shell argument to -1, for compatibility with BSD (#103421).
Version bump.

17 Jun 2005; Michael Hanselmann pdnsd-1.2.2.ebuild:
Stable on ppc.

12 Jun 2005; Bryan Østergaard pdnsd-1.2.2.ebuild:
Stable on alpha.

05 Jun 2005; Alin Nastac metadata.xml,
-pdnsd-1.1.11.ebuild, -pdnsd-1.1.12_pre3.ebuild, -pdnsd-1.2.1.ebuild,
pdnsd-1.2.2.ebuild:
Mark ver 1.2.2 stable on x86. Remove old test versions.

*pdnsd-1.2.2 (20 Apr 2005)

20 Apr 2005; Alin Nastac +pdnsd-1.2.2.ebuild:
Version bump

29 Dec 2004; Ciaran McCreesh :
Change encoding to UTF-8 for GLEP 31 compliance

*pdnsd-1.2.1 (01 Dec 2004)

01 Dec 2004; Daniel Black -pdnsd-1.1.9.ebuild,
+pdnsd-1.2.1.ebuild:
version bump and old version clean as per bug #72941. Thanks to Davin Boling


*pdnsd-1.1.12_pre3 (04 Oct 2004)

04 Oct 2004; Daniel Black +files/pdnsd.conf.test,
pdnsd-1.1.11.ebuild, +pdnsd-1.1.12_pre3.ebuild:
version bump as per bug #66219. -fbsd masked 1.1.11 due to upstream notice -
fixed in later versions. Thanks for the notification Daniel Webert


27 Jul 2004; Daniel Black pdnsd-1.1.10.ebuild,
pdnsd-1.1.11.ebuild, pdnsd-1.1.9.ebuild, -pdnsd-1.1.7a.ebuild:
enew{user,group} copied to pkg_preinst to fix binary packages (bug #58526).
Thanks to Thomas Matthijs . Removed old version

18 Jul 2004; Daniel Black pdnsd-1.1.10.ebuild,
pdnsd-1.1.11.ebuild:
Fix for bug #55901. Add user pdnsd in pkg_setup. Thanks to Daniel Webert.

01 Jul 2004; Jeremy Huddleston pdnsd-1.1.10.ebuild,
pdnsd-1.1.11.ebuild, pdnsd-1.1.7a.ebuild, pdnsd-1.1.9.ebuild:
virtual/glibc -> virtual/libc

09 Jun 2004; Aron Griffis pdnsd-1.1.7a.ebuild,
pdnsd-1.1.9.ebuild:
Fix use invocation

07 Jun 2004; Michael Sterrett pdnsd-1.1.10.ebuild,
pdnsd-1.1.11.ebuild:
src_preinst() -> pkg_preinst()

05 Jun 2004; Bryan Østergaard pdnsd-1.1.10.ebuild:
Stable on alpha.

*pdnsd-1.1.11 (05 Jun 2004)

05 Jun 2004; Daniel Black files/pdnsd.online,
files/pdnsd.rc6, pdnsd-1.1.10.ebuild, +pdnsd-1.1.11.ebuild:
version bump with a few dependancy/documentation fixes to version 1.1.10

06 May 2004; Daniel Black pdnsd-1.1.10.ebuild:
Added ~s390 keyword

30 Apr 2004; Bryan Østergaard pdnsd-1.1.10.ebuild:
Keyworded ~alpha.

26 Apr 2004; Michael McCabe pdnsd-1.1.9.ebuild:
Added s390 keywords

09 Apr 2004; Daniel Black pdnsd-1.1.10.ebuild:
Changed to add user/group pdnsd before the make install

03 Apr 2004; Daniel Black pdnsd-1.1.10.ebuild:
Stable on x86, ppc, sparc. Changed version 1.1.10 to use $ROOT when
checking on the existing installation. Warning again - from version
1.1.10 the cache is stored in /var/cache rather the /var/lib. If you
do an etc-update it should be smooth.

28 Mar 2004; Daniel Black pdnsd-1.1.6-r7.ebuild,
pdnsd-1.1.9.ebuild:
Stable on sparc & ppc - 1.1.9. Removed old versions

21 Mar 2004; Daniel Black :
Fixed digest - bug #45224 thanks to bugs.gentoo.org@tux.tmfweb.nl

16 Mar 2004; Daniel Black pdnsd-1.1.10.ebuild,
pdnsd-1.1.9.ebuild:
Added inherit eutils. Thanks to 's script for finding it

24 Feb 2004; Daniel Black pdnsd-1.1.10.ebuild:
As cachedir has changed to /var/cache, change the user's config ready for
etc-update.

*pdnsd-1.1.10 (23 Feb 2004)

23 Feb 2004; Daniel Black pdnsd-1.1.10.ebuild,
files/pdnsd.rc6:
ebuild cleanup.

22 Feb 2004; Daniel Black pdnsd-1.1.10.ebuild:
version bump. Avoid clobbering previous cache. Cache moved to /var/cache from
/var/lib.

22 Feb 2004; Daniel Black files/pdnsd.rc6:
Improved doco in init script

21 Feb 2004; Daniel Black files/pdnsd.rc6:
Added -s to files/pdnsd.rc6 to enable socket usage. Thanks to Eric Harney
bug #42149

19 Feb 2004; Daniel Black pdnsd-1.1.9.ebuild:
Bump to stable on x86. Few other small ebuild cleanups too.

03 Feb 2004; Daniel Black pdnsd-1.1.9.ebuild:
Added ~ppc and ~sparc. Should support alpha arm hppa i386 ia64 m68k mips
mipsel powerpc s390 sparc according to debian documentation

*pdnsd-1.1.9 (03 Feb 2004)

03 Feb 2004; Daniel Black metadata.xml,
pdnsd-1.1.6-r7.ebuild, pdnsd-1.1.7a.ebuild, pdnsd-1.1.9.ebuild,
files/pdnsd.online:
Version bump to include many patches. Adds pdnsd-online init-script too.
Fixes bug #20450.

09 Mar 2003; Daniel Ahlberg files/pdnsd.rc6 :
Fixed typo in init file. Closes #16881.

27 Feb 2003; Daniel Ahlberg pdnsd-1.1.7a.ebuild files/pdnsd.rc6 :
Add --tcp to daemon startup, closes #15657. Small fixes in 1.1.7a ebuild.

06 Dec 2002; Rodney Rees : changed sparc ~sparc keywords

*pdnsd-1.1.7a (05 Aug 2002)

17 Oct 2002; Daniel Ahlberg files/pdnsd.rc6 :
Closes #8758.

30 Aug 2002; Sascha Schwabbauer :
Added ppc to keywords.

05 Aug 2002; Daniel Ahlberg pdnsd-1.1.7a.ebuild:
Version bump that includes security fix, ebuild submitted
by tuxisuau .




*pdnsd-1.1.6-r7 (1 Feb 2002)

1 Feb 2002; G.Bevin 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.

Manifest

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AUX pdnsd.conf.test 377 RMD160 fbf25b78728754fa1f9cf5259c43cce9cb22a995 SHA1 bd7fdc0d89873921d5284e8d6713e62a424de704 SHA256 8ef1e68c43cefde86598158d2b624cbdd66d2436d681cabbc6327d34d5886058
AUX pdnsd.online 452 RMD160 45ecfe4acf625d62a299ee1ba46c6559901e2e66 SHA1 23998f42399430a457f3122ec906b9ef1b701520 SHA256 6fe3f33c7c5554f9577abfc5f7dc9547ba508ab68fe3590d8f1bb9598a865e9a
AUX pdnsd.rc6 850 RMD160 9700c23cbe4a8fb18a6492c04ec4e8d7b8d2c082 SHA1 b7a231bb4c486015895f1efc7fe566c2210fe384 SHA256 4406f536e237fb92547e25373500b16198e6eb1cf6ab6e54e9ed3effa4eaa4ba
AUX pdnsd.resolvconf 17365 RMD160 ea64795ebe6db99bbb304c86f2f2718ae3f9b034 SHA1 1485d59bbfdefa9faf3209b9bea2de30b204e813 SHA256 065679543e9cf3e20622265e3d009c5b68c213136c7632d257af0096b49fbbed
AUX pdnsd.resolvconf-r1 17538 RMD160 a79ab764cd96a7203165771d50b14f4bf3907141 SHA1 3afbba4b8eb5fad1e1268dab85cc1fc04b1258b2 SHA256 40bdcc876ba8bb86069d52f8023fed468974004f47c235c202ca7eac88aa0fe3
DIST pdnsd-1.2.6-par.tar.gz 451465 RMD160 4d7fc3b4bafc6dafc41e4d4b00e601f7de200c53 SHA1 ca9fcf1d214829dfcc7771a3443e9500fe6d305c SHA256 84a4165471856f71725e5dc958978d9aee671c33b94a7dca0be09e60d99069ed
EBUILD pdnsd-1.2.6-r1.ebuild 3433 RMD160 d4bc71626377f6d0d6e5050e52f9b1b324c8b1c1 SHA1 3aeae32c713f4b1c1d0cbf0b5ba1f62243877851 SHA256 3216cea70895a98ecf6a98d2c2937c5af70da71bb516d6ddbc816d59d167ef62
EBUILD pdnsd-1.2.6.ebuild 3421 RMD160 64e4f721d547e7e56ab652c5b25b7482a84b81a1 SHA1 9ca68ba923cfdc51b568f81bf5d9fbd6826958ad SHA256 23a2fb7f96bcdd7101adf82cb50f72c5126f14f121d25967b20126dbd4032604
MISC ChangeLog 11567 RMD160 f88ac221d2d3fd008cd2141f5a606ffc7eaa752d SHA1 a423bdc6138c3f669bb6c26a423e765c91609ec1 SHA256 2ad78bea7d36de4eab3d49438aaebb0ccfab9df4ac6ae6c7c2d6c330a6263617
MISC metadata.xml 402 RMD160 2dbd46b28843db4e7c216ec2d38354fe544d3d4b SHA1 8e51bef82c01c04db3c4a130b8bf726195c3acb9 SHA256 d5dba4f72c2ee03f15efe1a6954b8e81dc4d2e2842611cf5db90b9c241433ac6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFICs+m+fWpoTWIA9ERAmWAAJ9G3KytrX3sa1mWowfGSDSyBd7NKQCfW4gr
FBrmInk2kMnSMrOm6+GevGg=
=4ffA
-----END PGP SIGNATURE-----

files

metadata.xml




net-dialup
A proxy DNS server with permanent caching (the cache contents are written to hard disk on exit)
that is designed to cope with unreachable or down DNS servers (for example in dial-in networking).

pdnsd-1.2.6-r1.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.6-r1.ebuild,v 1.1 2008/04/20 05:07:38 mrness Exp $

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 nptl underscores urandom"

pkg_setup() {
enewgroup pdnsd
enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
}

src_compile() {
local myconf=""
use debug && myconf="${myconf} --with-debug=3"
use nptl && myconf="${myconf} --with-thread-lib=NPTL"
use urandom && myconf="${myconf} --with-random-device=/dev/urandom"

econf \
--sysconfdir=/etc/pdnsd \
--with-cachedir=/var/cache/pdnsd \
--with-default-id=pdnsd \
$(use_enable ipv6) \
$(use_enable isdn) \
$(use_enable underscores) \
${myconf} \
|| die "bad configure"

emake all || die "compile problem"
}

src_install() {
emake DESTDIR="${D}" install || die "make install failed"

dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par
docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl}
docinto html ; dohtml doc/html/*
docinto txt ; dodoc doc/txt/*
newdoc doc/pdnsd.conf pdnsd.conf.sample

newinitd "${FILESDIR}/pdnsd.rc6" pdnsd
newinitd "${FILESDIR}/pdnsd.online" pdnsd-online

dodir /etc/conf.d
local config="${D}/etc/conf.d/pdnsd-online"

echo -e "# Enter the interface that connects you to the dns servers" >> "${config}"
echo "# This will correspond to /etc/init.d/net.${IFACE}" >> "${config}"
echo -e "\n# IMPORTANT: Be sure to run depscan.sh after modifiying IFACE" >> "${config}"
echo "IFACE=ppp0" >> "${config}"

config="${D}/etc/conf.d/pdnsd"
"${D}/usr/sbin/pdnsd" --help | sed "s/^/# /g" > "${config}"
echo "# Command line options" >> "${config}"
use ipv6 && echo PDNSDCONFIG="-a" >> "${config}" \
|| echo PDNSDCONFIG="" >> "${config}"

# gentoo resolvconf support
exeinto /etc/resolvconf/update.d
newexe "${FILESDIR}/pdnsd.resolvconf-r1" pdnsd
}

src_test() {
if [ -x /usr/bin/dig ]; then
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" ] || die "no socket created"
src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || die "failed to start the daemon"
src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || die "failed to communicate with the daemon"
sleep 3

dig @127.0.0.1 -p 33455 www.gentoo.org | fgrep "status: NOERROR" || die "www.gentoo.org lookup failed"
kill $(<"${T}/pid") || die "failed to terminate daemon"
fi
}

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"
}

pdnsd-1.2.6.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.6.ebuild,v 1.5 2008/01/14 19:14:56 angelos Exp $

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 nptl underscores urandom"

pkg_setup() {
enewgroup pdnsd
enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
}

src_compile() {
local myconf=""
use debug && myconf="${myconf} --with-debug=3"
use nptl && myconf="${myconf} --with-thread-lib=NPTL"
use urandom && myconf="${myconf} --with-random-device=/dev/urandom"

econf \
--sysconfdir=/etc/pdnsd \
--with-cachedir=/var/cache/pdnsd \
--with-default-id=pdnsd \
$(use_enable ipv6) \
$(use_enable isdn) \
$(use_enable underscores) \
${myconf} \
|| die "bad configure"

emake all || die "compile problem"
}

src_install() {
emake DESTDIR="${D}" install || die "make install failed"

dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par
docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl}
docinto html ; dohtml doc/html/*
docinto txt ; dodoc doc/txt/*
newdoc doc/pdnsd.conf pdnsd.conf.sample

newinitd "${FILESDIR}/pdnsd.rc6" pdnsd
newinitd "${FILESDIR}/pdnsd.online" pdnsd-online

dodir /etc/conf.d
local config="${D}/etc/conf.d/pdnsd-online"

echo -e "# Enter the interface that connects you to the dns servers" >> "${config}"
echo "# This will correspond to /etc/init.d/net.${IFACE}" >> "${config}"
echo -e "\n# IMPORTANT: Be sure to run depscan.sh after modifiying IFACE" >> "${config}"
echo "IFACE=ppp0" >> "${config}"

config="${D}/etc/conf.d/pdnsd"
"${D}/usr/sbin/pdnsd" --help | sed "s/^/# /g" > "${config}"
echo "# Command line options" >> "${config}"
use ipv6 && echo PDNSDCONFIG="-a" >> "${config}" \
|| echo PDNSDCONFIG="" >> "${config}"

# gentoo resolvconf support
exeinto /etc/resolvconf/update.d
newexe "${FILESDIR}/pdnsd.resolvconf" pdnsd
}

src_test() {
if [ -x /usr/bin/dig ]; then
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" ] || die "no socket created"
src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || die "failed to start the daemon"
src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || die "failed to communicate with the daemon"
sleep 3

dig @127.0.0.1 -p 33455 www.gentoo.org | fgrep "status: NOERROR" || die "www.gentoo.org lookup failed"
kill $(<"${T}/pid") || die "failed to terminate daemon"
fi
}

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"
}