summaryrefslogtreecommitdiff
blob: b8e62ae9a303c9b59aa8eb435306a05076497b84 (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
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/net-tools/net-tools-1.60-r3.ebuild,v 1.7 2002/10/05 05:39:25 drobbins Exp $

IUSE="nls build"

S=${WORKDIR}/${P}
DESCRIPTION="standard Linux network tools"
SRC_URI="http://www.tazenda.demon.co.uk/phil/net-tools/${P}.tar.bz2"
HOMEPAGE="http://sites.inka.de/lina/linux/NetTools/"
KEYWORDS="x86 ppc sparc sparc64"
SLOT="0"
LICENSE="GPL-2"

DEPEND="virtual/glibc
		nls? ( sys-devel/gettext )"

src_unpack() {
	unpack ${A}
	cd ${S}
	cp ${FILESDIR}/config.h .
	cp ${FILESDIR}/config.make .
	cp Makefile Makefile.orig
	sed -e "s/-O2 -Wall -g/${CFLAGS}/" Makefile.orig > Makefile
	cd man
	cp Makefile Makefile.orig
	sed -e "s:/usr/man:/usr/share/man:" Makefile.orig > Makefile

	if [ -z "`use nls`" ]
	then
		cd ${S}
		mv config.h config.h.orig
		sed 's:\(#define I18N\) 1:\1 0:' config.h.orig > config.h

		mv config.make config.make.orig
		sed 's:I18N=1:I18N=0:' config.make.orig > config.make
	fi
	
}

src_compile() {
	# Changing "emake" to "make" closes half of bug #820; configure is run from *inside*
	# the Makefile, sometimes breaking parallel makes (if ./configure doesn't finish first) 
	
	make || die	

	if [ "`use nls`" ]
	then
		cd po
		make || die
	fi
}

src_install() {
	make BASEDIR=${D} install || die
	mv ${D}/bin/* ${D}/sbin
	for i in hostname domainname netstat dnsdomainname ypdomainname nisdomainname
	do
		mv ${D}/sbin/${i} ${D}/bin
	done
	dosym /bin/hostname /usr/bin/hostname
	if [ -z "`use bootcd`" ] && [ -z "`use build`" ]
	then
		dodoc COPYING README README.ipv6 TODO
	else
		rm -rf ${D}/usr/share
	fi
}