1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/djbdns-1.05-r23.ebuild,v 1.10 2012/06/14 02:04:37 zmedico Exp $
5 IUSE="doc ipv6 selinux static"
7 inherit eutils flag-o-matic toolchain-funcs user
9 DESCRIPTION="Excellent high-performance DNS services"
10 HOMEPAGE="http://cr.yp.to/djbdns.html"
14 http://cr.yp.to/djbdns/${P}.tar.gz
15 ipv6? ( http://www.fefe.de/dns/${P}-${IPV6_PATCH}.diff.bz2 )
19 LICENSE="public-domain"
20 KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
25 doc? ( app-doc/djbdns-man )
26 selinux? ( sec-policy/selinux-djbdns )
34 elog 'Several patches have been dropped from this djbdns ebuild revision.'
35 elog 'Please use the DJBDNS_PATCH_DIR variable to specify a directory'
36 elog 'of custom patches.'
38 elog 'Some of them can be found at http://tinydns.org/ or'
39 elog 'http://homepages.tesco.net/J.deBoynePollard/Softwares/djbdns/'
43 "${FILESDIR}/headtail.patch" \
44 "${FILESDIR}/dnsroots.patch" \
45 "${FILESDIR}/dnstracesort.patch"
48 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
51 elog "At present dnstrace does NOT support IPv6. It will"\
52 "be compiled without IPv6 support."
53 cp -pR "${S}" "${S}-noipv6"
54 # Careful -- >=test21 of the IPv6 patch includes the errno patch
55 epatch "${DISTDIR}/${P}-${IPV6_PATCH}.diff.bz2"
59 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6.patch" \
60 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch"
67 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
68 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
70 epatch "${FILESDIR}/${PV}-errno.patch"
72 if [[ -n "${DJBDNS_PATCH_DIR}" && -d "${DJBDNS_PATCH_DIR}" ]]
75 ewarn "You enabled custom patches from ${DJBDNS_PATCH_DIR}."
76 ewarn "Be warned that you won't get any support when using "
77 ewarn "this feature. You're on your own from now!"
80 cd "${S}" && epatch "${DJBDNS_PATCH_DIR}/"*
85 use static && append-ldflags -static
86 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
87 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
88 echo "/usr" > conf-home
89 emake -j1 || die "emake failed"
91 # If djbdns is compiled with IPv6 support, it breaks dnstrace.
92 # Therefore we must compile dnstrace separately without IPv6
95 elog "Compiling dnstrace without ipv6 support"
97 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
98 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
99 echo "/usr" > conf-home
100 emake -j1 dnstrace || die "emake failed"
106 doins dnsroots.global
109 dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
110 *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
111 dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
113 use ipv6 && dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace"
115 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
117 dobin "${FILESDIR}/dnscache-setup" || die
118 dobin "${FILESDIR}/tinydns-setup" || die
119 dobin "${FILESDIR}/djbdns-setup" || die
123 # The nofiles group is provided by baselayout
124 enewuser dnscache -1 -1 -1 nofiles
125 enewuser dnslog -1 -1 -1 nofiles
126 enewuser tinydns -1 -1 -1 nofiles
130 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."