| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/tcpdump/tcpdump-3.9.8.ebuild,v 1.9 2009/06/17 07:21:05 pva Exp $
|
| 4 |
|
| 5 |
inherit flag-o-matic toolchain-funcs eutils user
|
| 6 |
|
| 7 |
DESCRIPTION="A Tool for network monitoring and data acquisition"
|
| 8 |
HOMEPAGE="http://www.tcpdump.org/"
|
| 9 |
SRC_URI="http://www.tcpdump.org/release/${P}.tar.gz
|
| 10 |
http://www.jp.tcpdump.org/release/${P}.tar.gz"
|
| 11 |
|
| 12 |
LICENSE="BSD"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
|
| 15 |
IUSE="ssl ipv6 samba"
|
| 16 |
|
| 17 |
DEPEND="net-libs/libpcap
|
| 18 |
ssl? ( >=dev-libs/openssl-0.9.6m )"
|
| 19 |
RDEPEND="${DEPEND}"
|
| 20 |
|
| 21 |
pkg_setup() {
|
| 22 |
if use samba ; then
|
| 23 |
ewarn
|
| 24 |
ewarn "CAUTION !!! CAUTION !!! CAUTION"
|
| 25 |
ewarn
|
| 26 |
ewarn "You're about to compile tcpdump with samba printing support"
|
| 27 |
ewarn "Upstream tags it as 'possibly-buggy SMB printer'"
|
| 28 |
ewarn "So think twice whether this is fine with you"
|
| 29 |
ewarn
|
| 30 |
ewarn "CAUTION !!! CAUTION !!! CAUTION"
|
| 31 |
ewarn
|
| 32 |
ewarn "(Giving you 10 secs to think about it)"
|
| 33 |
ewarn
|
| 34 |
ebeep 5
|
| 35 |
epause 5
|
| 36 |
fi
|
| 37 |
}
|
| 38 |
|
| 39 |
src_compile() {
|
| 40 |
# tcpdump needs some optymalization. see bug #108391
|
| 41 |
( ! is-flag -O? || is-flag -O0 ) && append-flags -O
|
| 42 |
|
| 43 |
replace-flags -O[3-9] -O2
|
| 44 |
filter-flags -finline-functions
|
| 45 |
|
| 46 |
# Fix wrt bug #48747
|
| 47 |
if [[ $(gcc-major-version) -gt 3 ]] || \
|
| 48 |
[[ $(gcc-major-version) -eq 3 && $(gcc-minor-version) -ge 4 ]]
|
| 49 |
then
|
| 50 |
filter-flags -funit-at-a-time
|
| 51 |
append-flags -fno-unit-at-a-time
|
| 52 |
fi
|
| 53 |
|
| 54 |
local myconf
|
| 55 |
if ! use ssl ; then
|
| 56 |
myconf="--without-crypto"
|
| 57 |
fi
|
| 58 |
|
| 59 |
econf --with-user=tcpdump \
|
| 60 |
$(use_enable ipv6) \
|
| 61 |
$(use_enable samba smb) \
|
| 62 |
${myconf} || die "configure failed"
|
| 63 |
|
| 64 |
make CCOPT="$CFLAGS" || die "make failed"
|
| 65 |
}
|
| 66 |
|
| 67 |
pkg_preinst() {
|
| 68 |
enewgroup tcpdump
|
| 69 |
enewuser tcpdump -1 -1 -1 tcpdump
|
| 70 |
}
|
| 71 |
|
| 72 |
src_install() {
|
| 73 |
dosbin tcpdump
|
| 74 |
doman tcpdump.1
|
| 75 |
dodoc *.awk
|
| 76 |
dodoc README FILES VERSION CHANGES CREDITS TODO
|
| 77 |
}
|