summaryrefslogtreecommitdiff
blob: 198aa60b6dde989d938486627b0f27e4af1f82fc (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/aircrack-ng-0.7-r1.ebuild,v 1.2 2007/03/16 21:43:22 armin76 Exp $

inherit toolchain-funcs eutils

DESCRIPTION="WLAN tools for breaking 802.11 WEP/WPA keys"
HOMEPAGE="http://www.aircrack-ng.org"
SRC_URI="http://download.aircrack-ng.org/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc x86"
IUSE="wifi"

DEPEND="wifi? ( net-libs/libpcap )"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-make.patch"
}

src_compile() {
	local target
	use wifi || target="userland"
	emake -e CC="$(tc-getCC)" ${target} || die "emake failed"
}

src_install() {
	local target
	use wifi && target="install" || target="install_userland"
	emake \
		prefix=/usr \
		docdir="/usr/share/doc/${PF}" \
		mandir="/usr/share/man/man1" \
		destdir="${D}" \
		${target} \
		doc \
		|| die "emake install failed"
}

src_test() {
	#./makeivs wep.ivs 11111111111111111111111111 || die 'generating ivs file failed'
	#./aircrack-ng wep.ivs || die 'cracking WEP key failed'

	# Upstream uses signal in order to quit,
	# So protect busybox with process group leader.
	"$(tc-getCC)" -o process-group-leader "${FILESDIR}/process-group-leader.c"
	./process-group-leader ./aircrack-ng test/wpa.cap -w test/password.lst || die 'cracking WPA key failed'
}