summaryrefslogtreecommitdiff
blob: d4625a0150de18036b85e8f01e60a7aa0ec45881 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/trafd/trafd-3.0.1.ebuild,v 1.6 2004/06/15 21:56:48 squinky86 Exp $

inherit eutils

S=${WORKDIR}/${P}
DESCRIPTION="The BPF Traffic Collector"
SRC_URI="ftp://ftp.riss-telecom.ru/pub/dev/trafd/${P}.tgz
	http://metalab.unc.edu/pub/Linux/system/network/management/tcpdump-richard-1.7.tar.gz
	mirror://gentoo/${P}-gentoo.tar.bz2"
HOMEPAGE="ftp://ftp.riss-telecom.ru/pub/dev/trafd/"

SLOT="0"
LICENSE="BSD"
KEYWORDS="x86"

# -lbpft -lpcap -lcurses -ltermcap -lfl
DEPEND="net-libs/libpcap
	sys-libs/ncurses
	sys-devel/flex"

PATCHDIR=${WORKDIR}/${P}-gentoo

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${PATCHDIR}/${PF}-gentoo.diff

	sed -i "44s:-O2$:${CFLAGS}:; 52s:^INCLUDE.*:& -I../../tcpdump-richard-1.7/libpcap-0.0/bpf/:" Makefile
}

src_install () {
	dodir /usr/bin /etc /usr/share/doc/trafd-3.0.1 /var/trafd
	make install DESTDIR=${D} || die
	exeinto /etc/init.d ; newexe ${PATCHDIR}/trafd.init trafd
	insinto /etc/conf.d ; newins ${PATCHDIR}/trafd.conf trafd
}

pkg_postinst() {
	ewarn "NOTE: if you want to run trafd on boot then execute"
	ewarn "rc-update add trafd default"
	ewarn "change interfaces in /etc/conf.d/trafd (default is eth0)"
}