]> Pileus Git - ~andy/sunrise/blob - net-wireless/iwlwifi/iwlwifi-0.0.34-r1.ebuild
5d1314f12237a2bd8f28c6086ac0779219ce5d89
[~andy/sunrise] / net-wireless / iwlwifi / iwlwifi-0.0.34-r1.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit linux-mod
6
7 DESCRIPTION="Intel (R) PRO/Wireless 3945ABG Network Connection"
8 HOMEPAGE="http://intellinuxwireless.org/?p=iwlwifi"
9 SRC_URI="http://intellinuxwireless.org/${PN}/downloads/${P}.tgz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~x86 ~amd64"
14 IUSE=""
15
16 DEPEND="|| ( >=virtual/linux-sources-2.6.22_rc1 net-wireless/mac80211 )"
17 RDEPEND="net-wireless/iwlwifi-ucode"
18
19 S="${WORKDIR}/${P}/compatible"
20
21 MODULE_NAMES="iwl3945(net/wireless)"
22 BUILD_TARGETS="modules"
23
24 pkg_setup() {
25         if kernel_is ge 2 6 22; then
26                 CONFIG_CHECK="MAC80211"
27                 MY_INCLUDE="/usr/src/linux/"
28                 MY_HEADERS=""
29         else
30                 MY_INCLUDE="/usr/include/mac80211"
31                 MY_HEADERS="MAC80211_INC=/usr/include/mac80211/net/"
32         fi
33
34         linux-mod_pkg_setup
35         BUILD_PARAMS="-C '${KV_DIR}' M='${S}' CONFIG_IWL3945=m"
36 }
37
38 src_unpack() {
39         unpack ${A}
40         cd "${WORKDIR}/${P}"
41         sed -i -e 's/\(.*chmod\)/#\1/' Makefile
42         make compatible/kversion KSRC="${KV_DIR}" \
43                 ${MY_HEADERS} || die "make unmodified failed"
44         sed -i -e 's%\.\./\(net/mac80211/\)%\1%' "${S}"/*.c "${S}"/*.h
45         echo "CFLAGS += -I${MY_INCLUDE} -DCONFIG_IWLWIFI_DEBUG=y" \
46                 "-DCONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y" >> "${S}"/Makefile
47 }
48
49 pkg_postinst() {
50         linux-mod_pkg_postinst
51         elog
52         elog "As for kernel version 2.6.22, iwlwifi uses the in-kernel"
53         elog "version of mac80211"
54         elog
55 }