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-r24.ebuild,v 1.3 2011/04/04 18:58:49 c1pher Exp $
6 inherit eutils flag-o-matic toolchain-funcs
8 DESCRIPTION="Excellent high-performance DNS services"
9 HOMEPAGE="http://cr.yp.to/djbdns.html"
11 SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz"
14 LICENSE="public-domain"
15 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="doc ipv6 selinux static"
22 doc? ( app-doc/djbdns-man )
23 selinux? ( sec-policy/selinux-djbdns )
28 elog 'Several patches have been dropped from this djbdns ebuild revision.'
29 elog 'Please use the DJBDNS_PATCH_DIR variable to specify a directory'
30 elog 'of custom patches.'
32 elog 'Some of them can be found at http://tinydns.org/ or'
33 elog 'http://homepages.tesco.net/J.deBoynePollard/Softwares/djbdns/'
37 "${FILESDIR}/headtail.patch" \
38 "${FILESDIR}/dnsroots-r25.patch" \
39 "${FILESDIR}/dnstracesort.patch" \
40 "${FILESDIR}/string_length_255.patch"
43 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
47 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
48 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.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 "${FILESDIR}/ipv6-mjo.patch"
57 # The ipv6 patch is a little sloppy in the Makefile.
58 # Anything depending on socket.h should depend on uint32.h as well.
59 epatch "${FILESDIR}/makefile-uint32-fix.patch"
61 # Parts of the ipv6 patch fail due to the CVE2008-4392 fix above.
62 # The following two patches fix those hunks.
64 "${FILESDIR}/query.h-mjo.patch" \
65 "${FILESDIR}/query.c-mjo.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"
90 emake || 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"
102 emake dnstrace || die "emake failed"
108 doins dnsroots.global || die
111 dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
112 *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
113 dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort || die
116 dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace" || die
119 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION || die
121 dobin "${FILESDIR}/dnscache-setup" || die
122 dobin "${FILESDIR}/tinydns-setup" || die
123 newbin "${FILESDIR}/djbdns-setup-r17" djbdns-setup || die
127 # The nofiles group is provided by baselayout
128 enewuser dnscache -1 -1 -1 nofiles
129 enewuser dnslog -1 -1 -1 nofiles
130 enewuser tinydns -1 -1 -1 nofiles
134 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."