summaryrefslogtreecommitdiff
blob: 9cdc1f23fe0f0b2db65173e8c22fbc8f9e8c2ef7 (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
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Daniel Robbins <drobbins@gentoo.org>
# $Header: /var/cvsroot/gentoo-x86/net-misc/bind/bind-8.2.2.5-r1.ebuild,v 1.4 2000/11/01 04:44:21 achim Exp $

A=bind-src.tar.gz
S=${WORKDIR}/src
DESCRIPTION="Name Server"
SRC_URI="ftp://ftp.isc.org/isc/bind/src/8.2.2-P5/"${A}
HOMEPAGE="http://www.isc.org/products/BIND"

DEPEND=">=sys-apps/bash-2.04
	>=sys-libs/glibc-2.1.3"

src_compile() {                           
    try make clean
    try make depend
    try make all
}

src_unpack() {

    unpack ${A}
    cd ${S}/port/linux
    cp Makefile.set Makefile.set.orig
    sed -e 's/CDEBUG=-O -g/CDEBUG=${CFLAGS}/' Makefile.set.orig > Makefile.set
    cp Makefile.set Makefile.set.orig
    sed -e 's/DESTETC=\/etc/DESTETC=\/etc\/bind/' Makefile.set.orig > Makefile.set
    cd ${S}/bin
    cp Makefile Makefile.orig
    sed -e 's/CDEBUG= -g/#CDEBUG= -g/' Makefile.orig > Makefile
    cp Makefile Makefile.orig
    sed -e 's/CFLAGS=/#CFLAGS=/' Makefile.orig > Makefile
}

src_install() {
	into /usr
	for x in addr dig dnsquery host mkservdb nslookup nsupdate
	do
		dobin bin/${x}/${x}
	done	
	for x in dnskeygen irpd named named-bootconf named-xfer ndc
	do
		dosbin bin/${x}/${x}
	done

	dodoc CHANGES DNSSEC SUPPORT README LICENSE* TODO 
	docinto conf
	dodoc conf/README	
	docinto conf/recursive
	dodoc conf/recursive/* 
	docinto conf/recursive/pri
	dodoc conf/recursive/pri/* 
	docinto conf/workstation
	dodoc conf/workstation/* 
	docinto conf/workstation/pri
	dodoc conf/workstation/pri/* 
	dodir /etc/rc.d/init.d
	cp ${O}/files/named ${D}/etc/rc.d/init.d
	cp ${O}/files/named.conf ${D}/usr/doc/${PF}/conf/workstation/named.conf.gentoolinux
	dodir /etc/bind
	dodir /var/bind
}

pkg_config() {

    . ${ROOT}/etc/rc.d/config/functions

    if [ -e ${ROOT}/etc/bind/named.conf ]; then
	echo "You already have a named.conf in ${ROOT}/etc/bind/named.conf, not creating one."
    else
	install -m0644 ${ROOT}/usr/doc/${PF}/conf/workstation/named.conf.gentoolinux ${ROOT}/etc/bind/named.conf
	mkdir ${ROOT}/var/bind/pri
	gzip -d ${ROOT}/usr/doc/${PF}/conf/workstation/root.cache.gz
	gzip -d ${ROOT}/usr/doc/${PF}/conf/workstation/pri/*.gz
	install -m0644 ${ROOT}/usr/doc/${PF}/conf/workstation/root.cache ${ROOT}/var/bind/root.cache
	install -m0644 ${ROOT}/usr/doc/${PF}/conf/workstation/pri/* ${ROOT}/var/bind/pri/
    fi
    echo; 
    ${ROOT}/usr/sbin/rc-update add named 
    echo; einfo "BIND enabled."
}