summaryrefslogtreecommitdiff
blob: 48d7f32be7a51bd05a3195eed0f35c342bb2d964 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/madwifi-tools/madwifi-tools-0.1_pre20050106.ebuild,v 1.2 2005/01/19 13:24:09 solar Exp $

# cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi

DESCRIPTION="Wireless tools for Atheros chipset a/b/g cards"
HOMEPAGE="http://madwifi.sourceforge.net/"

SRC_URI="mirror://gentoo/${P/tools/driver}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"

KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="virtual/libc sys-apps/sed"
RDEPEND=""
S=${WORKDIR}

pkg_setup() {
	use x86 && TARGET=i386-elf
	use amd64 && TARGET=x86_64-elf
	export TARGET
}

src_unpack() {
	unpack ${A}
	cd ${S}
	sed -i -e 's/err(1, ifr.ifr_name);/err(1, "%s", ifr.ifr_name);'/g tools/athstats.c
}

src_compile() {
	einfo "building tools..."
	cd ${S}/tools || die "failed to chdir to ${S}/tools"
	make clean || :
	emake TARGET="${TARGET}" LDFLAGS="${CFLAGS} ${LDFLAGS}" \
		|| die "failed to build the driver tools"
}

src_install() {
	dodoc README COPYRIGHT
	cd ${S}/tools
	insinto /usr
	for bin in 80211stats ath{chans,ctrl,key,stats}; do
		[ -e ${bin} ] && dobin ${bin}
	done
}