# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 inherit kernel-mod eutils FIX_VERSION=43 FW_VERSION=307 DESCRIPTION="Driver for the ACX100 and ACX111 wireless chipset (CardBus and USB)" HOMEPAGE="http://acx100.sourceforge.net/" SRC_URI="http://lisas.de/~andi/${PN}/${P/_/}_plus_fixes_${FIX_VERSION}.tar.bz2 ftp://ftp.dlink.com/Wireless/dwl520+/Driver/dwl520+_drivers_${FW_VERSION}.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="usb" DEPEND="virtual/kernel" RDEPEND=">=sys-apps/hotplug-20030805-r2 net-wireless/wireless-tools" S=${WORKDIR}/${P/_/}_plus_fixes_${FIX_VERSION} FW_S=${WORKDIR}/tempfirmware pkg_setup() { local DIE=0 if ! kernel-mod_configoption_present NET_WIRELESS; then eerror "" eerror "${P} requires Wireless LAN drivers (non-hamradio) support &" eerror "Wireless Extensions (CONFIG_NET_WIRELESS)" eerror "in the kernel." DIE=1 else einfo "Wireless LAN drivers (non-hamradio) support & Wireless Extensions found" fi if ! kernel-mod_configoption_present NET_RADIO; then eerror "" eerror "${P} requires support for Wireless LAN drivers (non-hamradio) &" eerror "Wireless Extensions (CONFIG_NET_RADIO) in the kernel." DIE=1 else einfo "Wireless Extensions (CONFIG_NET_RADIO) found." fi if ! kernel-mod_configoption_present FW_LOADER; then eerror "" eerror "${P} requires Hotplug firmware loading support (CONFIG_FW_LOADER)" eerror "in the kernel." DIE=1 else einfo "Hotplug firmware loading support (CONFIG_FW_LOADER) found" fi if ! kernel-mod_configoption_present FW_LOADER; then eerror "" eerror "${P} requires Symmetric multi-processing support to be turned off." DIE=1 else einfo "Symmetric multi-processing support not found, good." fi kernel-mod_check_modules_supported if [ $DIE -eq 1 ]; then eerror "" die "You kernel is missing the required option(s) listed above." fi } src_unpack() { unpack ${P/_/}_plus_fixes_${FIX_VERSION}.tar.bz2 || die "Unpacking acx100 failed." mkdir ${FW_S} && cd ${FW_S} || die "Creation of temporary directory for firmware failed." unpack dwl520+_drivers_${FW_VERSION}.zip || die "Unpacking firmware failed." # NO IDEA, IF WE REALLY NEED THIS! cp ${FW_S}/Drivers/Win2000/WLANGEN.bin ${FW_S}/Drivers/Win2000/RADIO0d.BIN ${FW_S}/Drivers/Win2000/RADIO11.BIN ${S}/firmware && \ mv ${S}/firmware/WLANGEN.bin ${S}/firmware/WLANGEN.BIN || die "Firmware installation failed." kernel-mod_getversion } src_compile() { set_arch_to_kernel emake KVER=${KV} KDIR=${ROOT}/usr/src/linux all || die "emake failed" } src_install() { set_arch_to_kernel #emake KDIR=${ROOT}/usr/src/linux KMISC=${D}/lib/modules/${KV}/net install || die "emake failed" insinto /lib/modules/${KV}/net doins ${S}/src/acx_pci.ko use usb && doins ${S}/src/acx_usb.ko dodoc README TODO ChangeLog LICENSE insinto /usr/share/acx100 doins ${S}/firmware/*.BIN } pkg_postint() { einfo "Checking kernel module dependencies" test -r "${ROOT}/usr/src/linux/System.map" && \ depmod -ae -F "${ROOT}/usr/src/linux/System.map" -b "${ROOT}" -r ${KV} }