summaryrefslogtreecommitdiff
blob: 89e7ea5988f927d0bc334d28f157f1d708e88a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/djbdns-1.05-r10.ebuild,v 1.3 2004/06/24 22:34:07 agriffis Exp $

IUSE="ipv6 ipv6arpa static fwdzone roundrobin"

inherit eutils

DESCRIPTION="Excellent high-performance DNS services"
HOMEPAGE="http://cr.yp.to/djbdns.html"
SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz
	fwdzone? ( http://www.skarnet.org/software/djbdns-fwdzone/djbdns-1.04-fwdzone.patch )
	roundrobin? ( http://www.legend.co.uk/djb/dns/round-robin.patch )
	ipv6? ( http://www.fefe.de/dns/djbdns-1.05-test20.diff.bz2 )"

SLOT="0"
LICENSE="as-is"
KEYWORDS="~x86"

RDEPEND=">=sys-apps/daemontools-0.70
	sys-apps/ucspi-tcp"

src_unpack() {
	unpack ${A}
	cd ${S}

	use ipv6 && ( use fwdzone || use roundrobin ) && \
	eerror "ipv6 cannot currently be used with the fwdzone or " && \
	eerror "roundrobin patch." && \
	eerror && \
	eerror "If you would like to see ipv6 support along with one of " && \
	eerror "those other patches please submit a working patch that " && \
	eerror "combines ipv6 with either fwdzone or roundrobin but not " && \
	eerror "both at the same time, since the latter 2 patches are " && \
	eerror "mutually exclusive according to bug #31238." && exit -1

	use fwdzone && use roundrobin && \
	eerror "fwdzone and roundrobin do not work together according " && \
	eerror "to bug #31238" && exit -1

	use fwdzone && epatch ${DISTDIR}/djbdns-1.04-fwdzone.patch
	use roundrobin && epatch ${DISTDIR}/round-robin.patch
	use ipv6 && epatch ${WORKDIR}/djbdns-1.05-test20.diff
	use ipv6 && use ipv6arpa && \
		epatch ${FILESDIR}/djbdns-1.05-ipv6arpa+BSDok-gentoo.diff

	epatch ${FILESDIR}/${PV}-errno.patch
	epatch ${FILESDIR}/headtail.patch
}

src_compile() {
	LDFLAGS=
	use static && LDFLAGS="-static"
	echo "gcc ${CFLAGS}" > conf-cc
	echo "gcc ${LDFLAGS}" > conf-ld
	echo "/usr" > conf-home
	MAKEOPTS="-j1" emake || die "emake failed"
}

src_install() {
	insinto /etc
	doins dnsroots.global
	into /usr
	dobin *-conf dnscache tinydns walldns rbldns pickdns axfrdns \
	      *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \
	      dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort

	use ipv6 && dobin dnsip6 dnsip6q

	dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION

	dobin ${FILESDIR}/dnscache-setup
	dobin ${FILESDIR}/tinydns-setup
}

pkg_postinst() {
	groupadd &>/dev/null nofiles
	id &>/dev/null dnscache || \
		useradd -g nofiles -d /nonexistent -s /bin/false dnscache
	id &>/dev/null dnslog || \
		useradd -g nofiles -d /nonexistent -s /bin/false dnslog
	id &>/dev/null tinydns || \
		useradd -g nofiles -d /nonexistent -s /bin/false tinydns

	einfo "Use dnscache-setup and tinydns-setup to help you"
	einfo "configure your nameservers!"
}