# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 IUSE="" inherit linux-mod eutils DESCRIPTION="A linux (2.6-) kernel driver for Hauppauge's WinTV-PVR-usb2" HOMEPAGE="http://www.isely.net/pvrusb2.html" SRC_URI="http://www.isely.net/downloads/pvrusb2-mci-20060209.tar.bz2 http://www.eskimo.com/~roger/files/packages/pvrusb2/pvrusb2.f1.bz2 http://www.eskimo.com/~roger/files/packages/pvrusb2/pvrusb2.f2.bz2" # Check for the above firmwares. # If not found, instruct installer to get them by using fwextract.pl # and copying them into /usr/portage/disfiles # NOTE: The two firmware* files are stripped from a proprietory win32 driver! LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" RDEPEND=">=sys-apps/hotplug-20040923" DEPEND="" S=${WORKDIR}/pvrusb2-mci-20060209 # Need something to check for non-existing tuner.ko & tveeprom.ko modules if so, # then install all the modules. Maintainer of pvrusb2 prefers users using kernel # maintained tuner & tveeprom code! # ie. src_install # CONFIG_CHECK="bttv848" then install only pvrusb2.ko MODULE_NAMES="msp3400(msp3400:) pvrusb2(pvrusb2:) saa7115(saa7115:) tuner(tuner:) tveeprom(tveeprom:)" BUILD_PARAMS="KERNEL_DIR=${KV_DIR}" pkg_setup() { if kernel_is 2 4; then # You can try uncommenting "!VIDEO_BT848" but it's modules # are not working with pvrusb2 & me. # I'm marking it as a conflict as pvrusb2 provides tveeprom & tuner modules. # CONFIG_CHECK="USB !VIDEO_BT848" #else "You need kernel-2.6 for this module to work" die fi CONFIG_CHECK="USB" echo einfo "To build with kernel TUNER support" einfo "USE = pvrusb2-kernel" echo einfo "Newer pvrusb2 devices will not work with kernel TUNER support!" einfo "Check USB device ID's:" einfo "Old == 0x2900 New == 0x2400" einfo "New requires cx25840 while the Old require msp3400" echo einfo "If you're trying kernel provided TUNER support," einfo "you must manually remove the pvrusb2 provide TUNER modules" einfo "before emerging this package." einfo "ie. rm /lib/modules/2.6.15.5Y/pvrusb2/*" einfo "(This ebuild will not auto clean modules.)" echo linux-mod_pkg_setup } src_unpack() { unpack ${A} # If you use Mythtv, enabling interlacing will significantly # reduce cpu usage. Enter PVRUSB2="interlace" to make it so. if [[ $PVRUSB2 = "interlace" ]]; then cd ${S}/driver epatch ${FILESDIR}/interlace_enable.patch fi cd ${S} } src_compile() { unset ARCH cd ${S}/driver emake || die "Error: emake failed!" if ! use pvrusb2-kernel ; then echo einfo "Building pvrusb2 provided tuner modules." echo cd ${S}/ivtv emake || die "Error: emake failed!" fi } src_install() { # Make install doesn't work # Let's do the module install manually. #cd ${S}/driver insinto "/lib/modules/${KV_FULL}/pvrusb2" doins ${S}/driver/pvrusb2.ko if ! use pvrusb2-kernel ; then #cd ${S}/ivtv insinto "/lib/modules/${KV_FULL}/pvrusb2" doins ${S}/ivtv/msp3400.ko doins ${S}/ivtv/saa7115.ko doins ${S}/ivtv/tuner.ko doins ${S}/ivtv/tveeprom.ko fi insinto "/lib/firmware/" doins ${WORKDIR}/pvrusb2.f1 doins ${WORKDIR}/pvrusb2.f2 dodoc ${S}/LICENSE.TXT dodoc ${S}/README dohtml ${S}/doc/pvrusb2-eeprom.html dohtml ${S}/doc/pvrusb2-faq.html dohtml ${S}/doc/pvrusb2-utils.html dohtml ${S}/doc/pvrusb2.html dodir /usr/share/doc/${PF}/doc insinto /usr/share/doc/${PF}/doc dodoc ${S}/doc/README dodoc ${S}/doc/controls.txt dodoc ${S}/doc/notes.txt dodoc ${S}/doc/protocol-info.txt dodir /usr/share/doc/${PF}/misc insinto /usr/share/doc/${PF}/misc doins ${S}/misc/* dodir /usr/share/doc/${PF}/utils insinto /usr/share/doc/${PF}/utils doins ${S}/utils/* #echo "post-install pvrusb2 /sbin/modprobe pvrusb2 >& /dev/null 2>&1 || :" } pkg_postinst() { linux-mod_pkg_postinst echo einfo "1) To autoload pvrusb2, add 'pvrusb2' to" einfo " /etc/modules.autoload.d/kernel-2.6" echo einfo "2) Install sys-apps/hotplug and add hotplug" einfo " to the boot runlevel for added automation." echo }