--- hostap-driver-0.1.3.ebuild 2004-02-08 19:25:42.000000000 -0500 +++ hostap-driver-0.1.3-r1.ebuild 2004-02-09 02:10:07.750430592 -0500 @@ -3,11 +3,12 @@ # $Header: /home/cvsroot/gentoo-x86/net-wireless/hostap-driver/hostap-driver-0.1.3.ebuild,v 1.1 2004/02/09 00:25:42 wschlich Exp $ # pcmcia eclass inherits eutils -inherit pcmcia +inherit kernel-mod pcmcia DESCRIPTION="HostAP wireless drivers" HOMEPAGE="http://hostap.epitest.fi/" -SRC_URI="${SRC_URI} http://hostap.epitest.fi/releases/${P}.tar.gz" +SRC_URI="${SRC_URI} http://hostap.epitest.fi/releases/${P}.tar.gz + http://dev.gentoo.org/~latexer/files/patches/${P}-koutput.diff.gz" LICENSE="GPL-2" SLOT="${KV}" KEYWORDS="~x86" @@ -17,9 +18,12 @@ KMOD_PATH="/lib/modules/${KV}" +KERNEL_MOD_SOURCES="${P}.tar.gz" +KERNEL_MOD_KOUTPUT_PATCH="${DISTDIR}/${P}-koutput.diff.gz" + src_unpack() { - check_KV - unpack ${A} + # Unpack and set some variables + kernel-mod_src_unpack ## unpack the pcmcia-cs sources if needed pcmcia_src_unpack @@ -38,6 +42,15 @@ if [ -n "${PCMCIA_VERSION}" ]; then sed -i -e "s:^PCMCIA_PATH=:PCMCIA_PATH=${PCMCIA_SOURCE_DIR}:" ${S}/Makefile fi + + # If on 2.5 or 2.6, set the kernel output stuff + if [ "${KV_MINOR}" -gt "4" ] + then + sed -i -e \ + "s:^# KERNEL_OUTPUT_PATH=.*:KERNEL_OUTPUT_PATH=${KV_OUTPUT}:" \ + ${S}/Makefile + fi + } src_compile() { @@ -47,8 +60,8 @@ cd ${S} einfo "Building hostap-driver for kernel version: ${KV}" - case ${KV} in - 2.[34].*) + case ${KV_MINOR} in + [34]) local mydrivers use pcmcia && mydrivers="${mydrivers} pccard" @@ -58,7 +71,7 @@ einfo "Building the following drivers: ${mydrivers}" emake EXTRA_CFLAGS="-DPRISM2_DOWNLOAD_SUPPORT" ${mydrivers} || die "make failed" ;; - 2.[56].*) + [56]) unset ARCH emake EXTRA_CFLAGS="-DPRISM2_DOWNLOAD_SUPPORT" all || die "make failed" ;; @@ -71,11 +84,11 @@ src_install() { ## kernel 2.6 has a different module file name suffix - case ${KV} in - 2.[34].*) + case ${KV_MINOR} in + [34]) kobj=o ;; - 2.[56].*) + [56]) kobj=ko esac @@ -109,5 +122,13 @@ pkg_postinst(){ einfo "Checking kernel module dependancies" - cd /usr/src/linux && make _modinst_post ## depmod + # 2.6 completely re-installs modules when doing _modinst_post + case ${KV_MINOR} in + [34]) + cd /usr/src/linux && make _modinst_post ## depmod + ;; + [56]) + depmod -a + ;; + esac }