summaryrefslogtreecommitdiff
blob: af095af1b55ec4a7ff18ced1ac98ea87bcd88f9b (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils linux-mod

DESCRIPTION="Driver for the RaLink RT3572 USB wireless chipsets"
HOMEPAGE="http://www.ralinktech.com/support.php?s=2"
LICENSE="GPL-2"

RESTRICT="bindist fetch mirror"

MY_P="2011_0427_RT3572_Linux_STA"
MY_SUFFIX="DPO"

SRC_URI="${MY_P}_v${PV}.${MY_SUFFIX}.tar"

KEYWORDS="-* ~amd64 x86"
IUSE="debug"
SLOT="0"

DEPEND=""
RDEPEND="net-wireless/wireless-tools"

S="${WORKDIR}/${MY_P}_v${PV}.DPO"
MODULE_NAMES="rt3572sta(net:${S}:${S}/os/linux)"
BUILD_TARGETS=" "
MODULESD_RT3572STA_ALIASES=('ra? rt3572sta')
MODULESD_RT3572STA_ADDITIONS=('blacklist rt2800usb')

CONFIG_CHECK="WIRELESS_EXT"
ERROR_WIRELESS_EXT="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_WIRELESS_EXT)."


pkg_nofetch() {
	elog "Please download the tar.bz2 source named:"
	elog "RT3572USB version 2.5.0.0 from:"
	elog "http://www.ralinktech.com/support.php?s=2"
	elog "Then put the file in ${DISTDIR}/${SRC_URI}"
}

src_compile() {
	epatch ${FILESDIR}/${P}-Makefile.patch
	epatch ${FILESDIR}/${P}-config.mk.patch
	epatch ${FILESDIR}/${P}-rtusb_dev_id.c.patch
	use debug || epatch ${FILESDIR}/${P}-nodebug.patch

	linux-mod_src_compile
}

src_install() {
	linux-mod_src_install

	dodoc README_STA iwpriv_usage.txt
	insinto /etc/Wireless/RT2870STA
	insopts -m 0600
	doins RT2870STA.dat
	doins RT2870STACard.dat
	insinto /$(get_libdir)/firmware
	insopts -m 0644
	doins common/rt2870.bin
}

pkg_postinst() {
	linux-mod_pkg_postinst

	einfo
	einfo "Thanks to RaLink for releasing open drivers!"
	einfo
	einfo "The staging 'rt2800usb' kernel driver has been auto blacklisted."
	einfo "If you want to use it again, blacklist this driver ('rt3572sta')"
	einfo "and allow the 'rt2800usb' one."
	einfo
}