# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit kmod pcmcia MY_P=${P/_/} S=${WORKDIR}/${MY_P} DESCRIPTION="ORiNOCO wireless driver" HOMEPAGE="http://www.nongnu.org/orinoco/" SRC_URI="${SRC_URI} mirror://sourceforge/orinoco/${MY_P}.tar.gz" LICENSE="GPL-2 MPL-1.1" SLOT="0" KEYWORDS="~x86" IUSE="${IUSE}" DEPEND="virtual/kernel" RDEPEND="net-wireless/wireless-tools pcmcia? ( sys-apps/pcmcia-cs )" KMOD_SOURCES="${MY_P}.tar.gz" src_unpack() { kmod_universal_unpack ## only use external pcmcia sources with kernels 2.3 and 2.4 if is_kernel 2 3 || is_kernel 2 4; then pcmcia_universal_unpack ## set correct pcmcia path if [ -n "${PCMCIA_VERSION}" ]; then sed -i -e "s:^PCMCIA_CS =.*:PCMCIA_CS = ${PCMCIA_SOURCE_DIR}:" \ ${S}/Makefile fi fi ## use the kernel source found in /usr/src/linux sed -i -e "s:^KERNEL_SRC =.*:KERNEL_SRC = ${ROOT}/usr/src/linux/:" \ ${S}/Makefile ## locate the correct .config file sed -i -e "s:^DOT_CONFIG =.*:DOT_CONFIG = ${KV_OUTPUT}/.config:" \ ${S}/Makefile ## do not write to the real /etc/pcmcia sed -i -e "s:^CONF_DIR =.*:CONF_DIR = ${D}/etc/pcmcia/:" \ ${S}/Makefile ## ... or to the real /lib/modules sed -i -e "s:^MODULE_DIR_TOP =.*:MODULE_DIR_TOP = ${D}/lib/modules/${KV_VERSION_FULL}/:" \ ${S}/Makefile ## finally, let kmod handle depmod sed -i -e "s:\$(DEPMOD).*::" ${S}/Makefile } src_compile() { case ${KV_MINOR} in [34]) ## configure the pcmcia-cs sources pcmcia_configure ;; [56]) unset ARCH ;; *) eerror "Unsupported kernel version: ${KV}" die ;; esac emake || die "make failed" } src_install() { if is_kernel 2 5 || is_kernel 2 6; then unset ARCH fi emake install || die "make install failed" dodoc README.orinoco }