]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-dns/djbdns/djbdns-1.05-r24.ebuild
Stupid whitespace fix.
[mjo-overlay.git] / net-dns / djbdns / djbdns-1.05-r24.ebuild
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 $
4
5 IUSE="doc ipv6 selinux static"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 DESCRIPTION="Excellent high-performance DNS services"
10 HOMEPAGE="http://cr.yp.to/djbdns.html"
11 IPV6_PATCH="test23"
12
13 SRC_URI="
14 http://cr.yp.to/djbdns/${P}.tar.gz
15 ipv6? ( http://www.fefe.de/dns/${P}-${IPV6_PATCH}.diff.bz2 )
16 "
17
18 SLOT="0"
19 LICENSE="public-domain"
20 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
21
22 RDEPEND="
23 virtual/daemontools
24 sys-apps/ucspi-tcp
25 doc? ( app-doc/djbdns-man )
26 selinux? ( sec-policy/selinux-djbdns )
27 "
28
29 src_unpack() {
30 unpack "${P}.tar.gz"
31 cd "${S}"
32
33 echo
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.'
37 elog
38 elog 'Some of them can be found at http://tinydns.org/ or'
39 elog 'http://homepages.tesco.net/J.deBoynePollard/Softwares/djbdns/'
40 elog
41
42 epatch \
43 "${FILESDIR}/headtail.patch" \
44 "${FILESDIR}/dnsroots.patch" \
45 "${FILESDIR}/dnstracesort.patch" \
46 "${FILESDIR}/string_length_255.patch"
47
48 # Fix CVE2009-0858
49 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
50
51 if use ipv6; then
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"
57
58 # Fix CVE2008-4392
59 epatch \
60 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6.patch" \
61 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch"
62
63 cd "${S}-noipv6"
64 fi
65
66 # Fix CVE2008-4392
67 epatch \
68 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
69 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
70
71 epatch "${FILESDIR}/${PV}-errno.patch"
72
73 if [[ -n "${DJBDNS_PATCH_DIR}" && -d "${DJBDNS_PATCH_DIR}" ]]
74 then
75 echo
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!"
79 echo
80 ebeep
81 cd "${S}" && epatch "${DJBDNS_PATCH_DIR}/"*
82 fi
83 }
84
85 src_compile() {
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"
91
92 # If djbdns is compiled with IPv6 support, it breaks dnstrace.
93 # Therefore we must compile dnstrace separately without IPv6
94 # support.
95 if use ipv6; then
96 elog "Compiling dnstrace without ipv6 support"
97 cd "${S}-noipv6"
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 fi
103 }
104
105 src_install() {
106 insinto /etc
107 doins dnsroots.global
108
109 into /usr
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
113
114 use ipv6 && dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace"
115
116 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
117
118 dobin "${FILESDIR}/dnscache-setup"
119 dobin "${FILESDIR}/tinydns-setup"
120 newbin "${FILESDIR}/djbdns-setup-r17" djbdns-setup
121 }
122
123 pkg_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
128 }
129
130 pkg_postinst() {
131 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."
132 }