--- prism54-20040208.ebuild 2004-06-24 19:14:13.000000000 -0600 +++ prism54-1.2.ebuild 2004-11-20 20:09:18.514135544 -0700 @@ -2,13 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-wireless/prism54/prism54-20040208.ebuild,v 1.6 2004/06/25 00:46:56 agriffis Exp $ -MY_P=${P/prism54-/prism54-cvs} -DESCRIPTION="Driver for Intersil Prism GT / Prism Duette wireless chipsets" +# This ebuild will build the current release of the prism54 driver. +# It is designed so not to build the driver if your current kernel +# already has it in the main tree +DESCRIPTION="Driver/firmware for Intersil Prism GT / Prism Duette wireless chipsets" HOMEPAGE="http://prism54.org/" # nomirror for firmware issues. Emails sent to inquire about this. RESTRICT="nomirror" -SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 +SRC_URI="mirror://gentoo/${P}.tar.bz2 http://prism54.org/~mcgrof/firmware/isl3890" LICENSE="GPL-2" @@ -17,43 +19,80 @@ IUSE="pcmcia" DEPEND="virtual/kernel" -RDEPEND=">=sys-apps/hotplug-20030805-r2 +RDEPEND=">=sys-apps/hotplug-20040923 net-wireless/wireless-tools pcmcia? ( sys-apps/pcmcia-cs )" -S=${WORKDIR}/${MY_P} +inherit check-kernel + +pkg_setup() { -src_unpack() { check_KV + get_KV_info + + if is_2_6_kernel; then + if [[ "${KV_micro}" -gt 7 ]]; then + BUILD_DRIVER=0 + einfo "Your kernel has the most recent release of the driver" + einfo "built in, installing firmware" + else + BUILD_DRIVER=1 + einfo "Your kernel appears to not have the driver builtin" + einfo "We will be building the driver" + fi + elif is_2_4_kernel; then + if [[ "${KV_micro}" -gt 27 ]]; then + BUILD_DRIVER=0 + einfo "Your kernel has the most recent release of the driver" + einfo "built in, installing firmware" + else + BUILD_DRIVER=1 + einfo "Your kernel appears to not have the driver builtin" + einfo "We will be building the driver" + fi + else + BUILD_DRIVER=1 + einfo "Your kernel appears to not have the driver builtin" + einfo "We will be building the driver" + fi + +} +src_unpack() { einfo "Make sure you have CONFIG_FW_LOADER enabled in your kernel." einfo "2.6 users will need to disable sandbox for now to avoid" einfo "sandbox issues. See bug #32737 for info on work being done to" einfo "fix this." - einfo "Module versioning (CONFIG_MODVERSION) should be disabled." + einfo "Module versioning (CONFIG_MODVERSIONS) should be disabled." - unpack ${MY_P}.tar.bz2 + unpack ${P}.tar.bz2 } src_compile() { unset ARCH - make KVER=${KV} KDIR=/usr/src/linux modules || die + if [[ "${BUILD_DRIVER}" -eq 1 ]]; then + make KVER=${KV} KDIR=/usr/src/linux modules || die + fi } src_install() { - make KDIR=/usr/src/linux KVER=${KV} \ - KMISC=${D}/lib/modules/${KV}/kernel/drivers/net/wireless/prism54/ \ - install || die + if [[ "${BUILD_DRIVER}" -eq 1 ]]; then + make KDIR=/usr/src/linux KVER=${KV} \ + KMISC=${D}/lib/modules/${KV}/kernel/drivers/net/wireless/prism54/ \ + install || die + dodoc README ksrc/{TODO,ChangeLog} + fi # Install the firmware image - insinto /usr/lib/hotplug/firmware/ + insinto /lib/firmware/ doins ${DISTDIR}/isl3890 - dodoc README ksrc/{TODO,ChangeLog} } pkg_postinst() { if [[ ${ROOT} = / ]]; then - /sbin/depmod -a + if [[ "${BUILD_DRIVER}" -eq 1 ]]; then + /sbin/depmod -a + fi fi }