]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-dns/djbdns/djbdns-1.05-r27.ebuild
9b19cdb1b00c6c7c14e2ad4f64275a895a78d297
[mjo-overlay.git] / net-dns / djbdns / djbdns-1.05-r27.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-r24.ebuild,v 1.3 2011/04/04 18:58:49 c1pher Exp $
4
5 EAPI="2"
6 inherit eutils flag-o-matic toolchain-funcs
7
8 DESCRIPTION="Excellent high-performance DNS services"
9 HOMEPAGE="http://cr.yp.to/djbdns.html"
10
11 SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz"
12
13 SLOT="0"
14 LICENSE="public-domain"
15 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="doc ipv6 selinux static"
17
18 DEPEND=""
19 RDEPEND="${DEPEND}
20 virtual/daemontools
21 sys-apps/ucspi-tcp
22 doc? ( app-doc/djbdns-man )
23 selinux? ( sec-policy/selinux-djbdns )
24 "
25
26 src_prepare() {
27 echo
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.'
31 elog
32 elog 'Some of them can be found at http://tinydns.org/ or'
33 elog 'http://homepages.tesco.net/J.deBoynePollard/Softwares/djbdns/'
34 elog
35
36 epatch \
37 "${FILESDIR}/headtail.patch" \
38 "${FILESDIR}/dnsroots-r25.patch" \
39 "${FILESDIR}/dnstracesort.patch" \
40 "${FILESDIR}/string_length_255.patch"
41
42 # Fix CVE2009-0858
43 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
44
45 # Fix CVE2008-4392
46 epatch \
47 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
48 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
49
50 if use ipv6; then
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"
56
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"
60
61 # Parts of the ipv6 patch fail due to the CVE2008-4392 fix above.
62 # The following two patches fix those hunks.
63 epatch \
64 "${FILESDIR}/query.h-mjo.patch" \
65 "${FILESDIR}/query.c-mjo.patch"
66
67 cd "${S}-noipv6"
68 fi
69
70 epatch "${FILESDIR}/${PV}-errno.patch"
71
72 if [[ -n "${DJBDNS_PATCH_DIR}" && -d "${DJBDNS_PATCH_DIR}" ]]
73 then
74 echo
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!"
78 echo
79 ebeep
80 cd "${S}" && epatch "${DJBDNS_PATCH_DIR}/"*
81 fi
82 }
83
84 src_compile() {
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"
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 emake dnstrace || die "emake failed"
103 fi
104 }
105
106 src_install() {
107 insinto /etc
108 doins dnsroots.global || die
109
110 into /usr
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
114
115 if use ipv6; then
116 dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace" || die
117 fi
118
119 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION || die
120
121 dobin "${FILESDIR}/dnscache-setup" || die
122 dobin "${FILESDIR}/tinydns-setup" || die
123 newbin "${FILESDIR}/djbdns-setup-r17" djbdns-setup || die
124 }
125
126 pkg_preinst() {
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
131 }
132
133 pkg_postinst() {
134 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."
135 }