]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-dns/djbdns/djbdns-1.05-r28.ebuild
Use a separate makefule patch for net-dns/djbdns-1.05-r29.
[mjo-overlay.git] / net-dns / djbdns / djbdns-1.05-r28.ebuild
1 # Copyright 1999-2013 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-r28.ebuild,v 1.2 2013/08/14 11:30:23 patrick Exp $
4
5 EAPI=5
6 inherit eutils flag-o-matic readme.gentoo toolchain-funcs user
7
8 DESCRIPTION="Excellent high-performance DNS services"
9 HOMEPAGE="http://cr.yp.to/djbdns.html"
10 IPV6_PATCH="test23"
11
12 SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz
13 ipv6? ( http://www.fefe.de/dns/${P}-${IPV6_PATCH}.diff.bz2 )"
14
15 SLOT="0"
16 LICENSE="public-domain"
17 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
18 IUSE="doc ipv6 selinux static"
19
20 DEPEND=""
21 RDEPEND="
22 virtual/daemontools
23 sys-apps/ucspi-tcp
24 doc? ( app-doc/djbdns-man )
25 selinux? ( sec-policy/selinux-djbdns )"
26
27 src_prepare() {
28 epatch \
29 "${FILESDIR}/headtail.patch" \
30 "${FILESDIR}/dnsroots.patch" \
31 "${FILESDIR}/dnstracesort.patch" \
32 "${FILESDIR}/string_length_255.patch"
33
34 # Fix CVE2009-0858
35 epatch "${FILESDIR}/CVE2009-0858_0001-check-response-domain-name-length.patch"
36
37 if use ipv6; then
38 elog "At present dnstrace does NOT support IPv6. It will"\
39 "be compiled without IPv6 support."
40 cp -pR "${S}" "${S}-noipv6"
41 # Careful -- >=test21 of the IPv6 patch includes the errno patch
42 epatch "${DISTDIR}/${P}-${IPV6_PATCH}.diff.bz2"
43
44 # Fix CVE2008-4392
45 epatch \
46 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6.patch" \
47 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records-ipv6.patch" \
48 "${FILESDIR}/makefile-parallel.patch"
49
50 cd "${S}-noipv6"
51 fi
52
53 # Fix CVE2008-4392
54 epatch \
55 "${FILESDIR}/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries.patch" \
56 "${FILESDIR}/CVE2008-4392_0002-dnscache-cache-soa-records.patch"
57
58 epatch "${FILESDIR}/${PV}-errno.patch"
59
60 epatch_user
61 }
62
63 src_compile() {
64 use static && append-ldflags -static
65 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
66 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
67 echo "/usr" > conf-home
68 emake
69
70 # If djbdns is compiled with IPv6 support, it breaks dnstrace.
71 # Therefore we must compile dnstrace separately without IPv6
72 # support.
73 if use ipv6; then
74 elog "Compiling dnstrace without ipv6 support"
75 cd "${S}-noipv6"
76 echo "$(tc-getCC) ${CFLAGS}" > conf-cc
77 echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
78 echo "/usr" > conf-home
79 emake dnstrace
80 fi
81 }
82
83 src_install() {
84 insinto /etc
85 doins dnsroots.global
86
87 into /usr
88 dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
89 *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
90 dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
91
92 if use ipv6; then
93 dobin dnsip6 dnsip6q "${S}-noipv6/dnstrace"
94 fi
95
96 dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
97 readme.gentoo_create_doc
98 }
99
100 pkg_preinst() {
101 # The nofiles group is no longer provided by baselayout.
102 # Share it with qmail if possible.
103 enewgroup nofiles 200
104
105 enewuser dnscache -1 -1 -1 nofiles
106 enewuser dnslog -1 -1 -1 nofiles
107 enewuser tinydns -1 -1 -1 nofiles
108 }
109
110 DISABLE_AUTOFORMATTING=1
111 FORCE_PRINT_ELOG=1 #remove next bump
112 DOC_CONTENTS='
113 The dnscache-setup, tinydns-setup, and djbdns-setup programs have
114 been removed to follow upstream more closely. To configure djbdns,
115 please follow the instructions at,
116
117 http://cr.yp.to/djbdns.html
118
119 Of particular interest are,
120
121 axfrdns : http://cr.yp.to/djbdns/axfrdns-conf.html
122 dnscache: http://cr.yp.to/djbdns/run-cache-x-home.html
123 tinydns : http://cr.yp.to/djbdns/run-server.html
124
125 Portage has created users for axfrdns, dnscache, and tinydns; the
126 commands to configure these programs are,
127
128 1. axfrdns-conf tinydns dnslog /var/axfrdns /var/tinydns $ip
129 2. dnscache-conf dnscache dnslog /var/dnscache $ip
130 3. tinydns-conf tinydns dnslog /var/tinydns $ip
131
132 (replace \$ip with the ip address on which the server will run).
133
134 If you wish to configure rbldns or walldns, you will need to create
135 those users yourself (although you should still use the "dnslog"
136 user for the logs):
137
138 4. rbldns-conf $username dnslog /var/rbldns $ip $base
139 5. walldns-conf $username dnslog /var/walldns $ip
140 '