# 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="qt" DEPEND="virtual/kernel qt? qt" RDEPEND="" #DEPEND="X? ( >=x11-base/xfree-4.3 ) #mysql? ( >=dev-db/mysql-3.23.49 ) #apache2? ( >=net-www/apache-2 ) : ( =net-www/apache-1* )" 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 #patch the utility if qt is in use flags if use qt ; then cd ${S} epatch ${FILESDIR}/${P}-gentoo.diff #we're correcting an include bug here, nothing else ;) fi } src_compile() { unset ARCH #make the module cd ${S}/STA/Module make clean if [[ ${KV_MINOR} = "6" ]] ; then if [[ ${KV_MK_PATCH} < 6 ]] ; then emake -C /usr/src/linux SUBDIRS=${S}/STA/Module modules || die else emake -C /usr/src/linux M=${S}/STA/Module modules || die fi else #this has to be 2.4, as otherwise we wont be here chmod +x ./Configure emake all || die fi #build the utility if qt is in use flags if use qt ; then #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/Utility qmake -o Makefile raconfig2500.pro make clean emake || die export HOME="$REALHOME" #do we need this? fi } 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 if qt in use if use qt ; then dobin ${S}/STA/Utility/RaConfig2500 fi } 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} }