# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit kernel-mod eutils DESCRIPTION="Driver and Utilities for RaLink RT2500 wireless chipsets" HOMEPAGE="http://www.ralinktech.com.tw" MY_P=RT2500-Linux-STA-${PV} SRC_URI="http://www.ralinktech.com.tw/drivers/Linux/${MY_P}.tar.gz" LICENSE="freedist" # hope this is right" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="virtual/kernel virtual/x11 qt" RDEPEND="" S=${WORKDIR}/${MY_P} src_unpack() { check_KV kernel-mod_getversion unpack ${MY_P}.tar.gz einfo "Copying the approciate Makefile to work dir..." if [[ "${KV_MINOR}" = "6" ]] ; then cp -v ${S}/STA/Module/2.6.x/Makefile ${S}/STA/Module/ elif [[ "${KV_MINOR}" = "4" ]] ; then cp -v ${S}/STA/Module/2.4.x/Makefile ${S}/STA/Module/ fi # epatch ${FILESDIR}/spinlock.diff } src_compile() { unset ARCH #Here follows a workaround for the .qtrc write error, found on : #http://forums.gentoo.org/viewtopic.php?t=18733&highlight=qtrc+lock REALHOME="$HOME" mkdir -p ${T}/fakehome/.kde mkdir -p ${T}/fakehome/.qt export HOME="${T}/fakehome" addwrite "${QTDIR}/etc/settings" #make the utility cd ${S}/STA/Utilitys qmake -o Makefile raconfig2500.pro make clean emake || die #make the module cd ${S}/STA/Module make clean if [[ ${KV_MINOR} = "6" ]] ; then emake -C /usr/src/linux SUBDIRS=${S}/STA/Module modules || die else #this has to be 2.4, as otherwise we wont be here chmod +x ./Configure emake all || die fi # export HOME="$REALHOME" #do we need this? -> I don't think so ;-) } src_install() { # Install the kernel module and the docs provided from ralink if [[ ${KV_MINOR} = "6" ]] ; then KV_OBJ="ko" else KV_OBJ="o" fi dodoc ${S}/STA/Module/README ${S}/STA/Module/ReleaseNote insinto /lib/modules/${KV}/net doins ${S}/STA/Module/rt2500.${KV_OBJ} || die # Install the configuration software dobin ${S}/STA/Utility/RaConfig2500 } pkg_postinst() { if [[ ${KV_MINOR} = "6" ]] ; then KV_OBJ="ko" else KV_OBJ="o" fi 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} }