blob: 6b900bcdc7dfd9121b32955e4e4b96d3a6eca9bf (
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
|
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap-ringbuffer/libpcap-ringbuffer-0.9.20060417.ebuild,v 1.2 2006/07/25 09:01:17 dragonheart Exp $
inherit eutils toolchain-funcs linux-info multilib libtool autotools
MY_P=${PN:0:7}-${PV}
DESCRIPTION="A libpcap version which supports MMAP mode (ringbuffer) on the linux kernel 2.[46].x"
HOMEPAGE="http://public.lanl.gov/cpw/"
SRC_URI="http://public.lanl.gov/cpw/${MY_P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="ipv6"
DEPEND="!virtual/libpcap"
PROVIDE="virtual/libpcap"
S=${WORKDIR}/${MY_P}
# Used in linux-info to check minium Kernel support
CONFIG_CHECK="PACKET_MMAP"
PACKET_MMAP_ERROR="Make sure you have PACKET_MMAP compiled in your kernel to make use of libpcap's ringbuffer feature."
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}/${P}-makefile.patch"
eautoreconf
}
src_compile() {
econf $(use_enable ipv6) --enable-shared --with-pcap=linux || die "configure failed"
emake || die "make failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc CREDITS CHANGES FILES README* VERSION
dosym libpcap-0.9.3.so /usr/$(get_libdir)/libpcap.so.0.9
dosym libpcap-0.9.3.so /usr/$(get_libdir)/libpcap.so.0
#set PCAP_FRAMES=max
echo "PCAP_FRAMES=32768" > "${T}/99libpcap-ringbuffer"
doenvd "${T}/99libpcap-ringbuffer"
}
pkg_postinst() {
echo
einfo "Use of the ringbuffer requires that the environment variable PCAP_FRAMES be set."
einfo "This has automaticaly been set to the maximal accepted value"
einfo " PCAP_FRAMES=32768"
echo
einfo "This will tie up at around 51 Mbytes of memory for the ring buffer alone"
einfo "when capturing packets with tools like tcpdump or snort."
einfo "You can change this environment variable by editing"
einfo " /etc/env.d/99libpcap-ringbuffer"
einfo "and then run"
einfo " env-update && source /etc/profile"
echo
einfo "To continue to use libpcap-ringbuffer without the ringbuffer, just set PCAP_FRAMES=0"
einfo "in the env.d file. Alternatively, you could run wireshark like this:"
einfo " PCAP_FRAMES=0 wireshark"
echo
einfo "For further details see:"
einfo " /usr/share/doc/${PF}/README.ring.gz"
}
|