1 # Copyright 1999-2011 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.8 2011/01/29 23:36:52 bangert Exp $
5 IUSE="doc ipv6 selinux static"
7 inherit eutils flag-o-matic toolchain-funcs
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" \
46 "${FILESDIR}/string_length_255.patch"
49 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
52 elog "At present dnstrace does NOT support IPv6. It will"\
53 "be compiled without IPv6 support."
54 cp -pR "${S}" "${S}-noipv6"
55 # Careful -- >=test21 of the IPv6 patch includes the errno patch
56 epatch "${DISTDIR}/${P}-${IPV6_PATCH}.diff.bz2"
60 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6.patch" \
61 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch"
68 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
69 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
71 epatch "${FILESDIR}/${PV}-errno.patch"
73 if [[ -n "${DJBDNS_PATCH_DIR}" && -d "${DJBDNS_PATCH_DIR}" ]]
76 ewarn "You enabled custom patches from ${DJBDNS_PATCH_DIR}."
77 ewarn "Be warned that you won't get any support when using "
78 ewarn "this feature. You're on your own from now!"
81 cd "${S}" && epatch "${DJBDNS_PATCH_DIR}/"*
86 use static && append-ldflags -static
87 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
88 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
89 echo "/usr" > conf-home
90 emake -j1 || die "emake failed"
92 # If djbdns is compiled with IPv6 support, it breaks dnstrace.
93 # Therefore we must compile dnstrace separately without IPv6
96 elog "Compiling dnstrace without ipv6 support"
98 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
99 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
100 echo "/usr" > conf-home
101 emake -j1 dnstrace || die "emake failed"
107 doins dnsroots.global
110 dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
111 *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
112 dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
114 use ipv6 && dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace"
116 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
118 dobin "${FILESDIR}/dnscache-setup"
119 dobin "${FILESDIR}/tinydns-setup"
120 newbin "${FILESDIR}/djbdns-setup-r17" djbdns-setup
124 # The nofiles group is provided by baselayout
125 enewuser dnscache -1 -1 -1 nofiles
126 enewuser dnslog -1 -1 -1 nofiles
127 enewuser tinydns -1 -1 -1 nofiles
131 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."