4d918212d6fd4a2255c8fe5873800168afe8028e
[ub0rlay.git] / net-wireless / aircrack-ng / aircrack-ng-1.0_rc1.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/aircrack-ng-0.9.3.ebuild,v 1.1 2008/03/16 19:27:10 alonbl Exp $
4
5 inherit toolchain-funcs
6
7 MY_P=${P/_/-}
8
9 DESCRIPTION="WLAN tools for breaking 802.11 WEP/WPA keys"
10 HOMEPAGE="http://www.aircrack-ng.org"
11 SRC_URI="http://download.aircrack-ng.org/${MY_P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd"
16 #IUSE="wifi"
17
18 #DEPEND="wifi? ( net-libs/libpcap )"
19 DEPEND="net-libs/libpcap"
20
21 src_compile() {
22         cd ${MY_P}
23         emake || die "emake failed"
24         #local target
25         #use wifi || target="userland"
26         #emake -e CC="$(tc-getCC)" ${target} || die "emake failed"
27 }
28
29 src_install() {
30         cd ${MY_P}
31         #local target
32         #use wifi && target="install" || target="install_userland"
33         emake \
34                 prefix=/usr \
35                 docdir="/usr/share/doc/${PF}" \
36                 mandir="/usr/share/man/man1" \
37                 DESTDIR="${D}" \
38                 install \
39                 doc \
40                 || die "emake install failed"
41 }
42
43 src_test() {
44         #./makeivs wep.ivs 11111111111111111111111111 || die 'generating ivs file failed'
45         #./aircrack-ng wep.ivs || die 'cracking WEP key failed'
46
47         # Upstream uses signal in order to quit,
48         # So protect busybox with process group leader.
49         "$(tc-getCC)" -o process-group-leader "${FILESDIR}/process-group-leader.c"
50         ./process-group-leader ./aircrack-ng -w test/password.lst test/wpa.cap || die 'cracking WPA key failed'
51 }