# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info DESCRIPTION="Kernel-space driver for Alcatel SpeedTouch USB modems" HOMEPAGE="http://www.speedtouch.com/" SRC_URI="http://www.speedtouch.com/download/drivers/USB/SpeedTouch330_firmware_${PV//./}.zip http://download.ethomson.com/download/speedmgmt.tar.gz http://www.linux-usb.org/SpeedTouch/firmware/firmware-extractor.tar.gz" LICENSE="SpeedTouch-USB-Firmware" #taken from http://www.speedtouch.com/driver_upgrade_lx_${PV}.htm SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" IUSE="" DEPEND="app-arch/unzip sys-apps/coreutils" RDEPEND="net-dialup/ppp >=sys-apps/baselayout-1.11.13-r1 >=sys-fs/udev-068-r1 !net-dialup/speedtouch" S="${WORKDIR}/firmware-extractor" pkg_setup() { if kernel_is lt 2 6 10 ; then eerror "The kernel-space driver exists only in kernels >= 2.6.10." eerror "Please emerge net-dialup/speedtouch instead or upgrade the kernel." die "Unsupported kernel version" fi } pkg_config() { CONFIG_CHECK="KOBJECT_UEVENT !STANDALONE FW_LOADER NET PACKET ATM NETDEVICES \ PPP ~PPP_DEFLATE ~PPP_BSDCOMP PPPOATM USB USB_DEVICEFS USB_ATM USB_SPEEDTOUCH" check_extra_config echo einfo "Check pppd support for PPPoA" if ! built_with_use net-dialup/ppp atm; then eerror "net-dialup/ppp should be built with PPP over ATM support enabled." eerror "Run the following command and try again:" eerror " euse -E atm && emerge net-dialup/ppp" return 1 fi return 0 } src_compile() { gcc -o firmware-extractor firmware.c || die "firmware-extractor compile failed" } src_install() { local FILE_VER="${PV#*.}" FILE_VER="${PV%%.*}.${FILE_VER//./}" # {major_ver}.{minor_digits} einfo "Extracting firmware files" ./firmware-extractor ../mgmt/mgmt.o mv speedtch-1.bin speedtch-1.bin.0.00 mv speedtch-2.bin speedtch-2.bin.0.00 ./firmware-extractor ../KQD6_${FILE_VER} mv speedtch-1.bin speedtch-1.bin.2.00 mv speedtch-2.bin speedtch-2.bin.2.00 ./firmware-extractor ../ZZZL_${FILE_VER} mv speedtch-1.bin speedtch-1.bin.4.00 mv speedtch-2.bin speedtch-2.bin.4.00 # Copy to the firmware directory insinto /lib/firmware insopts -m 600 doins ${S}/speedtch-1.bin.0.00 doins ${S}/speedtch-2.bin.0.00 doins ${S}/speedtch-1.bin.2.00 doins ${S}/speedtch-2.bin.2.00 doins ${S}/speedtch-1.bin.4.00 doins ${S}/speedtch-2.bin.4.00 # Docs #dodoc ${FILESDIR}/README } pkg_postinst() { einfo "To complete the installation, you must read the documentation in" einfo "/usr/share/doc/${PF}" }