net-wireless/aircrack-ng: allow clang
[gentoo.git] / net-wireless / madwifi-ng-tools / madwifi-ng-tools-0.9.4.4165.20110816.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="2"
6
7 inherit versionator toolchain-funcs
8
9 MY_PN=${PN/-ng-tools/}
10 MY_PV=$(get_version_component_range 1-3)
11 MY_REV=$(get_version_component_range 4)
12 MY_DATE=$(get_version_component_range 5)
13 MY_P=${MY_PN}-${MY_PV}-r${MY_REV}-${MY_DATE}
14 S=${WORKDIR}/${MY_P}/tools
15
16 DESCRIPTION="Next Generation tools for configuration of Atheros based IEEE 802.11a/b/g wireless LAN cards"
17 HOMEPAGE="http://www.madwifi-project.org/"
18 SRC_URI="http://snapshots.madwifi-project.org/${MY_PN}-${MY_PV}/${MY_P}.tar.gz"
19
20 LICENSE="|| ( BSD GPL-2 )"
21 SLOT="0"
22 KEYWORDS="amd64 ppc x86"
23 IUSE=""
24
25 DEPEND=""
26 RDEPEND="!net-wireless/madwifi-old-tools"
27
28 src_prepare() {
29         # format string fix from solar
30         #sed -i \
31 #               -e 's:err(1, ifr.ifr_name);:err(1, "%s", ifr.ifr_name);:g' \
32 #               ${S}/tools/athstats.c || die
33
34         sed -i \
35                 -e "s:CC =.*:CC = $(tc-getCC):" \
36                 -e "s:CFLAGS=:CFLAGS+=:" \
37                 -e "s:LDFLAGS=:LDFLAGS+=:" \
38                 "${S}"/Makefile || die
39 }
40
41 src_install() {
42         emake DESTDIR="${D}" BINDIR=/usr/bin MANDIR=/usr/share/man STRIP=echo \
43                 install || die "emake install failed"
44
45         dodir /sbin
46         mv "${D}"/usr/bin/wlanconfig "${D}"/sbin
47
48         # install headers for use by
49         # net-wireless/wpa_supplicant and net-wireless/hostapd
50         cd "${S}"/..
51         insinto /usr/include/madwifi/include/
52         doins include/*.h
53         insinto /usr/include/madwifi/net80211
54         doins net80211/*.h
55 }
56
57 pkg_postinst() {
58         if [ -e "${ROOT}"/etc/udev/rules.d/65-madwifi.rules ]; then
59                 ewarn
60                 ewarn "The udev rules for creating interfaces (athX) are no longer needed."
61                 ewarn
62                 ewarn "You should manually remove the /etc/udev/rules.d/65-madwifi.rules file"
63                 ewarn "and either run 'udevstart' or reboot for the changes to take effect."
64                 ewarn
65         fi
66         einfo
67         einfo "If you use net-wireless/wpa_supplicant or net-wireless/hostapd with madwifi"
68         einfo "you should remerge them now."
69         einfo
70 }