Remove references to $ROOT from src_* functions (#168039).
authorAlin Năstac <mrness@gentoo.org>
Sat, 10 Mar 2007 14:03:48 +0000 (14:03 +0000)
committerAlin Năstac <mrness@gentoo.org>
Sat, 10 Mar 2007 14:03:48 +0000 (14:03 +0000)
Package-Manager: portage-2.1.2.2

net-dns/pdnsd/ChangeLog
net-dns/pdnsd/Manifest
net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild
net-dns/pdnsd/pdnsd-1.2.4-r3.ebuild
net-dns/pdnsd/pdnsd-1.2.5.ebuild

index 8b5784e8ee150cb1a9bb3feef57ecdd3cd6a41d8..e4c9ee3bdc5b44226e38fa39b4cd72990ff90ad7 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for net-dns/pdnsd
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.67 2007/01/16 20:47:38 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.68 2007/03/10 14:03:48 mrness Exp $
+
+  10 Mar 2007; Alin Năstac <mrness@gentoo.org> 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 <mrness@gentoo.org> pdnsd-1.2.5.ebuild:
   Stable on amd64.
index 2de733250dad3f30b6eedfcb245e741ccce1ad33..543724158dfca5f6108be430f7870c3381d52885 100644 (file)
@@ -23,22 +23,22 @@ RMD160 ea64795ebe6db99bbb304c86f2f2718ae3f9b034 files/pdnsd.resolvconf 17365
 SHA256 065679543e9cf3e20622265e3d009c5b68c213136c7632d257af0096b49fbbed files/pdnsd.resolvconf 17365
 DIST pdnsd-1.2.4-par.tar.gz 537362 RMD160 19cbb5d03eacdd8153ac3b9675cdbe07b1edfbd4 SHA1 60719a178b05214de6d98fff1455e05733cc75cd SHA256 b9172094feee0ebe6b2aec3c1358419cc928469e16c96718d7d0fc639fc17e55
 DIST pdnsd-1.2.5-par.tar.gz 537586 RMD160 c1444a746e3a8d1552608d0356cb14ed03d86fc1 SHA1 835a399a5ef3ea24f626c36b8eef0816985847b1 SHA256 679b308373cf89983bd21432090aad11bb3109ea2e58532f2e2ac0cb3b97462f
-EBUILD pdnsd-1.2.4-r1.ebuild 3966 RMD160 2602134414143573c35b96d5982f3095b7fcefda SHA1 efa80c873ea4e6c10b6ff680e218eee9c836da1a SHA256 c00ffd43258ba663e02c9bf77a10b1c5f58502114229489be9823dd58a4fee18
-MD5 c3789b9b9a48700ede6da87532e42700 pdnsd-1.2.4-r1.ebuild 3966
-RMD160 2602134414143573c35b96d5982f3095b7fcefda pdnsd-1.2.4-r1.ebuild 3966
-SHA256 c00ffd43258ba663e02c9bf77a10b1c5f58502114229489be9823dd58a4fee18 pdnsd-1.2.4-r1.ebuild 3966
-EBUILD pdnsd-1.2.4-r3.ebuild 4076 RMD160 65ea81a4cd2b14e67c86951c28a88513725e0fa2 SHA1 504f273f27edc8854111016a38c63007a01faee5 SHA256 7d8f75b5ce36098c3a3e4c9e4fff2bb62aceabb5848a8a579ebe66930c7ac7c7
-MD5 f9f73529f6e9a20ae8ca68d7fbb66c61 pdnsd-1.2.4-r3.ebuild 4076
-RMD160 65ea81a4cd2b14e67c86951c28a88513725e0fa2 pdnsd-1.2.4-r3.ebuild 4076
-SHA256 7d8f75b5ce36098c3a3e4c9e4fff2bb62aceabb5848a8a579ebe66930c7ac7c7 pdnsd-1.2.4-r3.ebuild 4076
-EBUILD pdnsd-1.2.5.ebuild 3963 RMD160 d26ccaee2abbc40bda22856aff0894c8c3021b9a SHA1 e53ecbcc6a6190ffbf4ca4ceae4c8465e1c9620c SHA256 e08bddc699e92fc263ead8c2473b37848c43462e4d3e6b458e0858b3b521484f
-MD5 942fb7882b43bab99122842ab7354b33 pdnsd-1.2.5.ebuild 3963
-RMD160 d26ccaee2abbc40bda22856aff0894c8c3021b9a pdnsd-1.2.5.ebuild 3963
-SHA256 e08bddc699e92fc263ead8c2473b37848c43462e4d3e6b458e0858b3b521484f pdnsd-1.2.5.ebuild 3963
-MISC ChangeLog 10024 RMD160 f2cb419a17cf83d46134c44c47483955db134951 SHA1 82f7866f594f36c700b35bccc63a626e63bda588 SHA256 493e8df3d7fac4dd608f35d6ddf1fa8795f8bc1c6ed873f8c88f327ffcb5a571
-MD5 977d16261f5c78a8c5d81da0efe5f7b0 ChangeLog 10024
-RMD160 f2cb419a17cf83d46134c44c47483955db134951 ChangeLog 10024
-SHA256 493e8df3d7fac4dd608f35d6ddf1fa8795f8bc1c6ed873f8c88f327ffcb5a571 ChangeLog 10024
+EBUILD pdnsd-1.2.4-r1.ebuild 3928 RMD160 4dc352cfc6f2db824b5c5b18cb63220a8a259a9b SHA1 a62bbe1139fa0dc796d0c1aead3f45c0171049f6 SHA256 3385d927f76922f2aebbaf97e15d765dedb6835a989b4ed8e41100826fdbec52
+MD5 f8d1d6d1c79630767f613c41c6020cb0 pdnsd-1.2.4-r1.ebuild 3928
+RMD160 4dc352cfc6f2db824b5c5b18cb63220a8a259a9b pdnsd-1.2.4-r1.ebuild 3928
+SHA256 3385d927f76922f2aebbaf97e15d765dedb6835a989b4ed8e41100826fdbec52 pdnsd-1.2.4-r1.ebuild 3928
+EBUILD pdnsd-1.2.4-r3.ebuild 4038 RMD160 1b657eaabefc49e0df58169fb03f8140f8dad6c5 SHA1 aa0d5a263dcfc4f5b7cfd4bafc691c37e37d3cab SHA256 afe03c8bbced36d4f8744f7447f08c5b986711c8aa9d002eda98ac02e62e930f
+MD5 3eb7115e36e9b6f900d946af2fe8beb4 pdnsd-1.2.4-r3.ebuild 4038
+RMD160 1b657eaabefc49e0df58169fb03f8140f8dad6c5 pdnsd-1.2.4-r3.ebuild 4038
+SHA256 afe03c8bbced36d4f8744f7447f08c5b986711c8aa9d002eda98ac02e62e930f pdnsd-1.2.4-r3.ebuild 4038
+EBUILD pdnsd-1.2.5.ebuild 3947 RMD160 dca0d678c08a350786d416d3cd083910339e5a43 SHA1 8f7cf245f1d0859ac6ba64318fca3984517addeb SHA256 8468d6f8e0199bde3f1f0f3b6bf4619e6d99a15dd821b54e2be11e9d50a0cb2f
+MD5 74bdef33bef178aa38a6fdfb0d137166 pdnsd-1.2.5.ebuild 3947
+RMD160 dca0d678c08a350786d416d3cd083910339e5a43 pdnsd-1.2.5.ebuild 3947
+SHA256 8468d6f8e0199bde3f1f0f3b6bf4619e6d99a15dd821b54e2be11e9d50a0cb2f pdnsd-1.2.5.ebuild 3947
+MISC ChangeLog 10202 RMD160 45db86d1baee50d670f57c64cfc831b31ef02284 SHA1 97c09d7a90c9f0958628937dc07fdb022de8d117 SHA256 7af41757e65a808e96bbfb345c8388fc650f3e4bd40c98fa5a90bf0210577511
+MD5 df58b5e1f7f11e3502ca556cbf5e4bd0 ChangeLog 10202
+RMD160 45db86d1baee50d670f57c64cfc831b31ef02284 ChangeLog 10202
+SHA256 7af41757e65a808e96bbfb345c8388fc650f3e4bd40c98fa5a90bf0210577511 ChangeLog 10202
 MISC metadata.xml 402 RMD160 2dbd46b28843db4e7c216ec2d38354fe544d3d4b SHA1 8e51bef82c01c04db3c4a130b8bf726195c3acb9 SHA256 d5dba4f72c2ee03f15efe1a6954b8e81dc4d2e2842611cf5db90b9c241433ac6
 MD5 03c559c81ebc357c5f906e8247f1b79b metadata.xml 402
 RMD160 2dbd46b28843db4e7c216ec2d38354fe544d3d4b metadata.xml 402
@@ -53,9 +53,9 @@ MD5 b217380df87dd99ecbcd955f049a7def files/digest-pdnsd-1.2.5 247
 RMD160 40c815ec61ca878b83d95c8a9a4b58b57a312085 files/digest-pdnsd-1.2.5 247
 SHA256 cadd2f658fe98f1e8a7194a51fec307aff7d8412d0d6feb03c550228f5bc053f files/digest-pdnsd-1.2.5 247
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.1 (GNU/Linux)
+Version: GnuPG v2.0.3 (GNU/Linux)
 
-iD8DBQFFrTn1JnxX6mF440QRAiMtAKCJGCwEkpQCTSqnXIByh1O3f34Z7gCg2QZD
-07kDpT/Vk2BkexXG3kKZzLc=
-=rtAE
+iD8DBQFF8rrOJnxX6mF440QRAiwJAKDDb39teMTsOgiAEiPT2ORsmm0APgCfTsvs
+Es1tdGjYeU0xX2w5e1m7xrQ=
+=LL9Z
 -----END PGP SIGNATURE-----
index 0b15fc96614c38091f67ee331ff977389893edae..04dd5f0b88e5175783e0d03a3c35118a55e801d4 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild,v 1.5 2006/11/12 04:09:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild,v 1.6 2007/03/10 14:03:48 mrness Exp $
 
 inherit eutils
 
@@ -47,17 +47,38 @@ src_compile() {
        emake all || die "compile problem"
 }
 
-pkg_preinst() {
-       # Duplicated so that binary packages work
-       enewgroup pdnsd
-       enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
+src_install() {
+       emake DESTDIR="${D}" install || die
+
+       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
+
+       keepdir /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}"
 }
 
 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 "${ROOT}/etc/resolv.conf" | sed -e 's/nameserver \(.*\)/\tip=\1;/g' | xargs)
+               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"
@@ -75,40 +96,18 @@ src_test() {
        fi
 }
 
-src_install() {
-       emake DESTDIR="${D}" install || die
+pkg_preinst() {
+       # Duplicated so that binary packages work
+       enewgroup pdnsd
+       enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
 
-       # Copy cache from prev older versions
+       # Copy cache from older versions
        [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
                cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
 
-       # Don't clobber existing cache - copy prev cache so unmerging prev version
-       # doesn't remove the cache.
+       # Preserve the cache from previous version
        [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
-               rm  "${D}/var/cache/pdnsd/pdnsd.cache"
-
-       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
-
-       keepdir /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}"
+               cp "${ROOT}/var/cache/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
 }
 
 pkg_postinst() {
index 83b00a3f86d6160c8b7b809d9fdd82845492fc26..ae3a73e2e980d3d8fd4292d53d518f517fba8c72 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.4-r3.ebuild,v 1.5 2006/11/12 04:09:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.4-r3.ebuild,v 1.6 2007/03/10 14:03:48 mrness Exp $
 
 inherit eutils
 
@@ -47,46 +47,9 @@ src_compile() {
        emake all || die "compile problem"
 }
 
-pkg_preinst() {
-       # Duplicated so that binary packages work
-       enewgroup pdnsd
-       enewuser pdnsd -1 -1 /var/lib/pdnsd 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 "${ROOT}/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
-}
-
 src_install() {
        emake DESTDIR="${D}" install || die
 
-       # Copy cache from prev older versions
-       [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
-               cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
-
-       # Don't clobber existing cache - copy prev cache so unmerging prev version
-       # doesn't remove the cache.
-       [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
-               rm  "${D}/var/cache/pdnsd/pdnsd.cache"
-
        dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par
        docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl}
        docinto html ; dohtml doc/html/*
@@ -115,6 +78,42 @@ src_install() {
        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_preinst() {
+       # Duplicated so that binary packages work
+       enewgroup pdnsd
+       enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
+
+       # Copy cache from older versions
+       [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
+               cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
+
+       # Preserve the cache from previous version
+       [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
+               cp "${ROOT}/var/cache/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
+}
+
 pkg_postinst() {
        einfo
        einfo "Add pdnsd to your default runlevel - rc-update add pdnsd default"
index 1299abbd54cffea7cd499c942760b55bc1c7d160..f7e00fec4e1635494756f845d2084f43d4d7f85b 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.5.ebuild,v 1.5 2007/01/16 20:47:38 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.5.ebuild,v 1.6 2007/03/10 14:03:48 mrness Exp $
 
 inherit eutils
 
@@ -40,45 +40,8 @@ src_compile() {
        emake all || die "compile problem"
 }
 
-pkg_preinst() {
-       # Duplicated so that binary packages work
-       enewgroup pdnsd
-       enewuser pdnsd -1 -1 /var/lib/pdnsd 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 "${ROOT}/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
-}
-
 src_install() {
-       emake DESTDIR="${D}" install || die
-
-       # Copy cache from prev older versions
-       [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
-               cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
-
-       # Don't clobber existing cache - copy prev cache so unmerging prev version
-       # doesn't remove the cache.
-       [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
-               rm  "${D}/var/cache/pdnsd/pdnsd.cache"
+       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}
@@ -108,6 +71,42 @@ src_install() {
        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_preinst() {
+       # Duplicated so that binary packages work
+       enewgroup pdnsd
+       enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
+
+       # Copy cache from older versions
+       [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
+               cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
+
+       # Preserve the cache from previous version
+       [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
+               cp "${ROOT}/var/cache/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
+}
+
 pkg_postinst() {
        einfo
        einfo "Add pdnsd to your default runlevel - rc-update add pdnsd default"