# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit kernel-mod eutils multilib linux-info linux-mod toolchain-funcs DESCRIPTION="Linux Kernel Driver for a USB webcam based on the SQ 905 chipset like Che-ez! Snap/iClick" HOMEPAGE="http://sourceforge.net/projects/sqcam/" SRC_URI="http://prdownloads.sourceforge.net/sqcam/sqcam_driver_for_kernel_2_6-${PV}b.tar.gz" LICENSE="GPL" SLOT="0" KEYWORDS="~x86 ~ppc64 ~amd64" IUSE="" DEPEND="sys-kernel/linux-headers" RDEPEND="" S=${WORKDIR}/sqcam_driver_for_kernel_2_6 src_unpack() { unpack ${A} cd "${S}" } src_compile() { # fix for kernel 2.6.11 and over epatch ${FILESDIR}/sqcam-${PV}b-2.6.12.patch export ARCH="$(tc-arch-kernel)" emake KSRC="${KERNEL_DIR}" || die "make failed" # emake ARCH=i386 || die "make failed" } src_install() { if kernel_is 2 6; then einfo "Kernel ${KV_FULL} detected!" insinto "/lib/modules/${KV_FULL}/kernel/drivers/usb/media/" doins sqcam.ko echo "post-install sqcam /sbin/modprobe --force sqcam >& /dev/null 2>&1 || :" > usb-sqcam else eerror "No supported kernel version (2.6) detected." fi insinto /etc/modules.d } pkg_postinst() { if [ "${ROOT}" = "/" ] then # Update module dependency [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules depmod -a fi einfo "If you have problems loading the module, please check the \"dmesg\" output." }