# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ S=${WORKDIR}/ndiswrapper DESCRIPTION="ndiswrapper" HOMEPAGE="http://ndiswrapper.sourceforge.net/" SRC_URI="mirror://sourceforge/ndiswrapper/ndiswrapper-0.4.tar.gz" LICENSE="" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="sys-devel/flex" src_compile() { cd ${S}/driver make cd ${S}/utils make } src_install() { dobin ${S}/utils/loadndisdriver DIR=/lib/modules/`uname -r`/misc dodir ${DIR} cp ${S}/driver/ndiswrapper.*o ${D}/${DIR} dodoc ${S}/README I=`lspci -n | grep 'Class 0280:' | awk '{print $4}'` VENDOR=`echo $I | perl -e 'while() {/^(\w*):/;print $1;}'` DEVICEID=`echo $I | perl -e 'while() {/:(\w*)$/;print $1;}'` dodir /etc/conf.d echo "SYS= #Windows SYS file" >${D}/etc/conf.d/ndiswrapper echo "INF= #Windows INF file" >>${D}/etc/conf.d/ndiswrapper echo "IFACE=eth1" >>${D}/etc/conf.d/ndiswrapper echo "VENDERID=$VENDOR #Use lspci">> ${D}/etc/conf.d/ndiswrapper echo "DEVICEID=$DEVICEID" >>${D}/etc/conf.d/ndiswrapper dodir /etc/modules.d echo "#!/bin/sh">${D}/etc/modules.d/ndiswapper echo ". /etc/conf.d/ndiswrapper">>${D}/etc/modules.d/ndiswapper echo "echo alias \$IFACE ndiswrapper">>${D}/etc/modules.d/ndiswapper echo "echo post-install \$IFACE loadndisdriver \$VENDERID \$DEVICEID \$SYS \$INF">>${D}/etc/modules.d/ndiswapper chmod a+rx ${D}/etc/modules.d/ndiswapper } pkg_postinst() { [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules einfo einfo "Get the .inf and .sys files from the windows driver and edit /etc/conf.d/ndiswrapper" einfo }