]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-dns/djbdns/djbdns-1.05-r27.ebuild
Fix the Makefile uint32.h issue.
[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 # Parts of the ipv6 patch fail due to the CVE2008-4392 fix above.
58 # The following two patches fix those hunks.
59 epatch \
60 "${FILESDIR}/query.h-mjo.patch" \
61 "${FILESDIR}/query.c-mjo.patch"
62
63 cd "${S}-noipv6"
64 fi
65
66 epatch "${FILESDIR}/${PV}-errno.patch"
67
68 if [[ -n "${DJBDNS_PATCH_DIR}" && -d "${DJBDNS_PATCH_DIR}" ]]
69 then
70 echo
71 ewarn "You enabled custom patches from ${DJBDNS_PATCH_DIR}."
72 ewarn "Be warned that you won't get any support when using "
73 ewarn "this feature. You're on your own from now!"
74 echo
75 ebeep
76 cd "${S}" && epatch "${DJBDNS_PATCH_DIR}/"*
77 fi
78 }
79
80 src_compile() {
81 use static && append-ldflags -static
82 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
83 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
84 echo "/usr" > conf-home
85 #emake -j1 || die "emake failed"
86 emake || die "emake failed"
87
88 # If djbdns is compiled with IPv6 support, it breaks dnstrace.
89 # Therefore we must compile dnstrace separately without IPv6
90 # support.
91 if use ipv6; then
92 elog "Compiling dnstrace without ipv6 support"
93 cd "${S}-noipv6"
94 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
95 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
96 echo "/usr" > conf-home
97 #emake -j1 dnstrace || die "emake failed"
98 emake dnstrace || die "emake failed"
99 fi
100 }
101
102 src_install() {
103 insinto /etc
104 doins dnsroots.global || die
105
106 into /usr
107 dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
108 *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
109 dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort || die
110
111 if use ipv6; then
112 dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace" || die
113 fi
114
115 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION || die
116
117 dobin "${FILESDIR}/dnscache-setup" || die
118 dobin "${FILESDIR}/tinydns-setup" || die
119 newbin "${FILESDIR}/djbdns-setup-r17" djbdns-setup || die
120 }
121
122 pkg_preinst() {
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
127 }
128
129 pkg_postinst() {
130 elog "Use dnscache-setup & tinydns-setup or djbdns-setup to configure djbdns."
131 }