summaryrefslogtreecommitdiff
blob: 04e2e405a24c90f9812f6e5b332a5839f6983ffd (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
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/djbdns/djbdns-1.05-r5.ebuild,v 1.3 2002/12/09 04:33:11 manson Exp $

DESCRIPTION="Excellent high-performance DNS services"
SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz
	http://www.skarnet.org/software/djbdns-fwdzone/djbdns-1.04-fwdzone.patch
	mirror://${P}-ipv6-gentoo.diff.bz2"
HOMEPAGE="http://cr.yp.to/djbdns.html"
LICENSE="as-is"
KEYWORDS="~x86 ~sparc "
SLOT="0"
IUSE="ipv6 static"

DEPEND="virtual/glibc"
RDEPEND="${DEPEND}
	>=sys-apps/daemontools-0.70
	sys-apps/ucspi-tcp"

S="${WORKDIR}/${P}"

src_unpack() {
	unpack ${P}.tar.gz
	patch -d ${S} -p1 < ${DISTDIR}/djbdns-1.04-fwdzone.patch
	if [ `use ipv6` ] ; then
		bunzip2 -dc ${DISTDIR}/djbdns-1.05-ipv6-gentoo.diff.bz2 |
		patch -d ${S} -p1 || die "Failed to apply the ipv6 patch"
	fi
}

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

src_install() {                               
	insinto /etc
	doins dnsroots.global
	into /usr
	for i in *-conf dnscache tinydns walldns rbldns pickdns axfrdns *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
	do
		dobin $i
	done
	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 configure your nameservers!"
}