diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2005-12-03 13:49:33 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2005-12-03 13:49:33 +0000 |
commit | d2fbc415c60e08326ad50a64020b5e113b03f2bb (patch) | |
tree | fb858ebbbd398e40b5794c2cf92848dfb0741512 /media-tv/linuxtv-dvb-firmware | |
parent | Add orinoco_usb.ko with USE=usb, thanks to jetsaredim on IRC. (diff) | |
download | historical-d2fbc415c60e08326ad50a64020b5e113b03f2bb.tar.gz historical-d2fbc415c60e08326ad50a64020b5e113b03f2bb.tar.bz2 historical-d2fbc415c60e08326ad50a64020b5e113b03f2bb.zip |
Initial import of firmware-ebuild written by myself
Package-Manager: portage-2.0.53
Diffstat (limited to 'media-tv/linuxtv-dvb-firmware')
-rw-r--r-- | media-tv/linuxtv-dvb-firmware/ChangeLog | 10 | ||||
-rw-r--r-- | media-tv/linuxtv-dvb-firmware/Manifest | 5 | ||||
-rw-r--r-- | media-tv/linuxtv-dvb-firmware/files/digest-linuxtv-dvb-firmware-1 | 7 | ||||
-rwxr-xr-x | media-tv/linuxtv-dvb-firmware/files/get_dvb_firmware-1 | 414 | ||||
-rw-r--r-- | media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-1.ebuild | 186 | ||||
-rw-r--r-- | media-tv/linuxtv-dvb-firmware/metadata.xml | 12 |
6 files changed, 634 insertions, 0 deletions
diff --git a/media-tv/linuxtv-dvb-firmware/ChangeLog b/media-tv/linuxtv-dvb-firmware/ChangeLog new file mode 100644 index 000000000000..2cdba316205a --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for media-tv/linuxtv-dvb-firmware +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/media-tv/linuxtv-dvb-firmware/ChangeLog,v 1.1 2005/12/03 13:49:32 zzam Exp $ + +*linuxtv-dvb-firmware-1 (03 Dec 2005) + + 03 Dec 2005; Matthias Schwarzott <zzam@gentoo.org> + +files/get_dvb_firmware-1, +metadata.xml, +linuxtv-dvb-firmware-1.ebuild: + Initial import of firmware-ebuild written by myself + diff --git a/media-tv/linuxtv-dvb-firmware/Manifest b/media-tv/linuxtv-dvb-firmware/Manifest new file mode 100644 index 000000000000..8330345ad3d1 --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/Manifest @@ -0,0 +1,5 @@ +MD5 586c0c1ec8d575bfab77a96f02790213 ChangeLog 452 +MD5 72138cbe19fa4abff6f3fb2e75265683 files/digest-linuxtv-dvb-firmware-1 469 +MD5 cf50072da5b600c439d7c82e127a7f62 files/get_dvb_firmware-1 11537 +MD5 ea5b98e1a81f186d32f3364a555d762c linuxtv-dvb-firmware-1.ebuild 4238 +MD5 7c30ab7528b676a1a0c2737821599b29 metadata.xml 300 diff --git a/media-tv/linuxtv-dvb-firmware/files/digest-linuxtv-dvb-firmware-1 b/media-tv/linuxtv-dvb-firmware/files/digest-linuxtv-dvb-firmware-1 new file mode 100644 index 000000000000..95992b4e6d76 --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/files/digest-linuxtv-dvb-firmware-1 @@ -0,0 +1,7 @@ +MD5 292ada6f90218a6bace6b72fe22eeec6 AVerTVHD_MCE_A180_Drv_v1.2.2.16.zip 156028 +MD5 230cce6550a5ca1d63c3ff2fbc6b75c3 Broadband4PC_4_2_11.zip 6698229 +MD5 28db715d5e7a11bf85dd0240a42758f4 Dvbt1.3.57.6.zip 12174738 +MD5 b96dde610256d896e8e1b37ae577796d dec217g.exe 16371951 +MD5 abdd8102bb5b09314985a8ac9eaf8d83 dvb-firmwares-1.tar.bz2 182356 +MD5 f296fb50e2de3d5929b231994395cd24 tt_Premium_217g.zip 11348671 +MD5 bf511c80f48b49fa93c53ee6921303b5 tt_budget_217g.zip 12656253 diff --git a/media-tv/linuxtv-dvb-firmware/files/get_dvb_firmware-1 b/media-tv/linuxtv-dvb-firmware/files/get_dvb_firmware-1 new file mode 100755 index 000000000000..a0f409dcabb2 --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/files/get_dvb_firmware-1 @@ -0,0 +1,414 @@ +#!/usr/bin/perl +# DVB firmware extractor +# +# (c) 2004 Andrew de Quincey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +use File::Temp qw/ tempdir /; +use IO::Handle; + +@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", + "dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", + "or51211", "or51132_qam", "or51132_vsb"); + +# Check args +syntax() if (scalar(@ARGV) != 1); +$cid = $ARGV[0]; + +# Do it! +for ($i=0; $i < scalar(@components); $i++) { + if ($cid eq $components[$i]) { + $outfile = eval($cid); + die $@ if $@; + print STDERR "Firmware $outfile extracted successfully. Now copy it to either /lib/firmware or /usr/lib/hotplug/firmware/ (depending on your hotplug version).\n"; + exit(0); + } +} + +# If we get here, it wasn't found +print STDERR "Unknown component \"$cid\"\n"; +syntax(); + + + + +# --------------------------------------------------------------- +# Firmware-specific extraction subroutines + +sub sp8870 { + my $sourcefile = "tt_Premium_217g.zip"; + my $url = "http://www.technotrend.de/new/217g/$sourcefile"; + my $hash = "53970ec17a538945a6d8cb608a7b3899"; + my $outfile = "dvb-fe-sp8870.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/software/OEM/HE/App/boot/SC_MAIN.MC", $hash); + copy("$tmpdir/software/OEM/HE/App/boot/SC_MAIN.MC", $outfile); + + $outfile; +} + +sub sp887x { + my $sourcefile = "Dvbt1.3.57.6.zip"; + my $url = "http://www.avermedia.com/software/$sourcefile"; + my $cabfile = "DVBT Net Ver1.3.57.6/disk1/data1.cab"; + my $hash = "237938d53a7f834c05c42b894ca68ac3"; + my $outfile = "dvb-fe-sp887x.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + checkunshield(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + unshield("$tmpdir/$cabfile", $tmpdir); + verify("$tmpdir/ZEnglish/sc_main.mc", $hash); + copy("$tmpdir/ZEnglish/sc_main.mc", $outfile); + + $outfile; +} + +sub tda10045 { + my $sourcefile = "tt_budget_217g.zip"; + my $url = "http://www.technotrend.de/new/217g/$sourcefile"; + my $hash = "2105fd5bf37842fbcdfa4bfd58f3594a"; + my $outfile = "dvb-fe-tda10045.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + extract("$tmpdir/software/OEM/PCI/App/ttlcdacc.dll", 0x37ef9, 30555, "$tmpdir/fwtmp"); + verify("$tmpdir/fwtmp", $hash); + copy("$tmpdir/fwtmp", $outfile); + + $outfile; +} + +sub tda10046 { + my $sourcefile = "tt_budget_217g.zip"; + my $url = "http://www.technotrend.de/new/217g/$sourcefile"; + my $hash = "6a7e1e2f2644b162ff0502367553c72d"; + my $outfile = "dvb-fe-tda10046.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + extract("$tmpdir/software/OEM/PCI/App/ttlcdacc.dll", 0x3f731, 24478, "$tmpdir/fwtmp"); + verify("$tmpdir/fwtmp", $hash); + copy("$tmpdir/fwtmp", $outfile); + + $outfile; +} + +sub av7110 { + my $sourcefile = "dvb-ttpci-01.fw-261d"; + my $url = "http://www.linuxtv.org/downloads/firmware/$sourcefile"; + my $hash = "603431b6259715a8e88f376a53b64e2f"; + my $outfile = "dvb-ttpci-01.fw"; + + checkstandard(); + + wgetfile($sourcefile, $url); + verify($sourcefile, $hash); + copy($sourcefile, $outfile); + + $outfile; +} + +sub dec2000t { + my $sourcefile = "dec217g.exe"; + my $url = "http://hauppauge.lightpath.net/de/$sourcefile"; + my $hash = "bd86f458cee4a8f0a8ce2d20c66215a9"; + my $outfile = "dvb-ttusb-dec-2000t.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/software/OEM/STB/App/Boot/STB_PC_T.bin", $hash); + copy("$tmpdir/software/OEM/STB/App/Boot/STB_PC_T.bin", $outfile); + + $outfile; +} + +sub dec2540t { + my $sourcefile = "dec217g.exe"; + my $url = "http://hauppauge.lightpath.net/de/$sourcefile"; + my $hash = "53e58f4f5b5c2930beee74a7681fed92"; + my $outfile = "dvb-ttusb-dec-2540t.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/software/OEM/STB/App/Boot/STB_PC_X.bin", $hash); + copy("$tmpdir/software/OEM/STB/App/Boot/STB_PC_X.bin", $outfile); + + $outfile; +} + +sub dec3000s { + my $sourcefile = "dec217g.exe"; + my $url = "http://hauppauge.lightpath.net/de/$sourcefile"; + my $hash = "b013ececea83f4d6d8d2a29ac7c1b448"; + my $outfile = "dvb-ttusb-dec-3000s.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/software/OEM/STB/App/Boot/STB_PC_S.bin", $hash); + copy("$tmpdir/software/OEM/STB/App/Boot/STB_PC_S.bin", $outfile); + + $outfile; +} + +sub vp7041 { + my $sourcefile = "2.422.zip"; + my $url = "http://www.twinhan.com/files/driver/USB-Ter/$sourcefile"; + my $hash = "e88c9372d1f66609a3e7b072c53fbcfe"; + my $outfile = "dvb-vp7041-2.422.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + extract("$tmpdir/VisionDTV/Drivers/Win2K&XP/UDTTload.sys", 12503, 3036, "$tmpdir/fwtmp1"); + extract("$tmpdir/VisionDTV/Drivers/Win2K&XP/UDTTload.sys", 2207, 10274, "$tmpdir/fwtmp2"); + + my $CMD = "\000\001\000\222\177\000"; + my $PAD = "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"; + my ($FW); + open $FW, ">$tmpdir/fwtmp3"; + print $FW "$CMD\001$PAD"; + print $FW "$CMD\001$PAD"; + appendfile($FW, "$tmpdir/fwtmp1"); + print $FW "$CMD\000$PAD"; + print $FW "$CMD\001$PAD"; + appendfile($FW, "$tmpdir/fwtmp2"); + print $FW "$CMD\001$PAD"; + print $FW "$CMD\000$PAD"; + close($FW); + + verify("$tmpdir/fwtmp3", $hash); + copy("$tmpdir/fwtmp3", $outfile); + + $outfile; +} + +sub dibusb { + my $url = "http://www.linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw"; + my $outfile = "dvb-usb-dibusb-5.0.0.11.fw"; + my $hash = "fa490295a527360ca16dcdf3224ca243"; + + checkstandard(); + + wgetfile($outfile, $url); + verify($outfile,$hash); + + $outfile; +} + +sub nxt2002 { + my $sourcefile = "Broadband4PC_4_2_11.zip"; + my $url = "http://www.bbti.us/download/windows/$sourcefile"; + my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; + my $outfile = "dvb-fe-nxt2002.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/SkyNETU.sys", $hash); + extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); + + $outfile; +} + +sub nxt2004 { + my $sourcefile = "AVerTVHD_MCE_A180_Drv_v1.2.2.16.zip"; + my $url = "http://www.aver.com/support/Drivers/$sourcefile"; + my $hash = "111cb885b1e009188346d72acfed024c"; + my $outfile = "dvb-fe-nxt2004.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/3xHybrid.sys", $hash); + extract("$tmpdir/3xHybrid.sys", 465304, 9584, $outfile); + + $outfile; +} + +sub or51211 { + my $fwfile = "dvb-fe-or51211.fw"; + my $url = "http://linuxtv.org/downloads/firmware/$fwfile"; + my $hash = "d830949c771a289505bf9eafc225d491"; + + checkstandard(); + + wgetfile($fwfile, $url); + verify($fwfile, $hash); + + $fwfile; +} + +sub or51132_qam { + my $fwfile = "dvb-fe-or51132-qam.fw"; + my $url = "http://linuxtv.org/downloads/firmware/$fwfile"; + my $hash = "7702e8938612de46ccadfe9b413cb3b5"; + + checkstandard(); + + wgetfile($fwfile, $url); + verify($fwfile, $hash); + + $fwfile; +} + +sub or51132_vsb { + my $fwfile = "dvb-fe-or51132-vsb.fw"; + my $url = "http://linuxtv.org/downloads/firmware/$fwfile"; + my $hash = "c16208e02f36fc439a557ad4c613364a"; + + checkstandard(); + + wgetfile($fwfile, $url); + verify($fwfile, $hash); + + $fwfile; +} + +# --------------------------------------------------------------- +# Utilities + +sub checkstandard { + if (system("which unzip > /dev/null 2>&1")) { + die "This firmware requires the unzip command - see ftp://ftp.info-zip.org/pub/infozip/UnZip.html\n"; + } + if (system("which md5sum > /dev/null 2>&1")) { + die "This firmware requires the md5sum command - see http://www.gnu.org/software/coreutils/\n"; + } + if (system("which wget > /dev/null 2>&1")) { + die "This firmware requires the wget command - see http://wget.sunsite.dk/\n"; + } +} + +sub checkunshield { + if (system("which unshield > /dev/null 2>&1")) { + die "This firmware requires the unshield command - see http://sourceforge.net/projects/synce/\n"; + } +} + +sub wgetfile { + my ($sourcefile, $url) = @_; + + if (! -f $sourcefile) { + system("wget -O \"$sourcefile\" \"$url\"") and die "wget failed - unable to download firmware"; + } +} + +sub unzip { + my ($sourcefile, $todir) = @_; + + $status = system("unzip -q -o -d \"$todir\" \"$sourcefile\" 2>/dev/null" ); + if ((($status >> 8) > 2) || (($status & 0xff) != 0)) { + die ("unzip failed - unable to extract firmware"); + } +} + +sub unshield { + my ($sourcefile, $todir) = @_; + + system("unshield x -d \"$todir\" \"$sourcefile\" > /dev/null" ) and die ("unshield failed - unable to extract firmware"); +} + +sub verify { + my ($filename, $hash) = @_; + my ($testhash); + + open(CMD, "md5sum \"$filename\"|"); + $testhash = <CMD>; + $testhash =~ /([a-zA-Z0-9]*)/; + $testhash = $1; + close CMD; + die "Hash of extracted file does not match!\n" if ($testhash ne $hash); +} + +sub copy { + my ($from, $to) = @_; + + system("cp -f \"$from\" \"$to\"") and die ("cp failed"); +} + +sub extract { + my ($infile, $offset, $length, $outfile) = @_; + my ($chunklength, $buf, $rcount); + + open INFILE, "<$infile"; + open OUTFILE, ">$outfile"; + sysseek(INFILE, $offset, SEEK_SET); + while($length > 0) { + # Calc chunk size + $chunklength = 2048; + $chunklength = $length if ($chunklength > $length); + + $rcount = sysread(INFILE, $buf, $chunklength); + die "Ran out of data\n" if ($rcount != $chunklength); + syswrite(OUTFILE, $buf); + $length -= $rcount; + } + close INFILE; + close OUTFILE; +} + +sub appendfile { + my ($FH, $infile) = @_; + my ($buf); + + open INFILE, "<$infile"; + while(1) { + $rcount = sysread(INFILE, $buf, 2048); + last if ($rcount == 0); + print $FH $buf; + } + close(INFILE); +} + +sub syntax() { + print STDERR "syntax: get_dvb_firmware <component>\n"; + print STDERR "Supported components:\n"; + for($i=0; $i < scalar(@components); $i++) { + print STDERR "\t" . $components[$i] . "\n"; + } + exit(1); +} diff --git a/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-1.ebuild b/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-1.ebuild new file mode 100644 index 000000000000..87533e47696c --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-1.ebuild @@ -0,0 +1,186 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-1.ebuild,v 1.1 2005/12/03 13:49:32 zzam Exp $ + +DESCRIPTION="Firmware files needed for operation of some dvb-devices" +HOMEPAGE="http://www.linuxtv.org" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +DEPEND="dvb_cards_sp887x? ( >=app-arch/unshield-0.4 )" + +RDEPEND="" + +RESTRICT="nomirror" + +S="${WORKDIR}" + + +# Files which can be fetched from linuxtv.org +PACKET_SRC_URI="http://www.linuxtv.org/downloads/firmware/dvb-firmwares-1.tar.bz2" +get_dvb_firmware="${FILESDIR}/get_dvb_firmware-${PV}" + +PACKET_FW_NAMES=( + "or51132-qam" + "or51132-vsb" + "or51211" + "avertv" + "dibusb" + "dibusb-usb2" + "dtt200u" + "umt" + "vp702x" + "vp7045" + "wt220u" + "ttpci" +) + +PACKET_FW_FILES=( + "dvb-fe-or51132-qam.fw" + "dvb-fe-or51132-vsb.fw" + "dvb-fe-or51211.fw" + "dvb-usb-avertv-a800-02.fw" + "dvb-usb-dibusb-5.0.0.11.fw" + "dvb-usb-dibusb-6.0.0.8.fw" + "dvb-usb-dtt200u-01.fw" + "dvb-usb-umt-010-02.fw" + "dvb-usb-vp702x-01.fw" + "dvb-usb-vp7045-01.fw" + "dvb-usb-wt220u-01.fw" + "dvb-ttpci-01.fw" +) + +# firmwares which have to be fetched with get_dvb_firmware +FW_NAMES=( + "sp8870" + "sp887x" + "tda10045" + "tda10046" + "dec2000t" + "dec2540t" + "dec3000s" + "nxt2002" + "nxt2004" +) + +FW_FILES=( + "dvb-fe-sp8870.fw" + "dvb-fe-sp887x.fw" + "dvb-fe-tda10045.fw" + "dvb-fe-tda10046.fw" + "dvb-ttusb-dec-2000t.fw" + "dvb-ttusb-dec-2540t.fw" + "dvb-ttusb-dec-3000s.fw" + "dvb-fe-nxt2002.fw" + "dvb-fe-nxt2004.fw" +) + +FW_URLS=( + "http://www.technotrend.de/new/217g/tt_Premium_217g.zip" + "http://www.avermedia.com/software/Dvbt1.3.57.6.zip" + "http://www.technotrend.de/new/217g/tt_budget_217g.zip" + "http://www.technotrend.de/new/217g/tt_budget_217g.zip" + "http://hauppauge.lightpath.net/de/dec217g.exe" + "http://hauppauge.lightpath.net/de/dec217g.exe" + "http://hauppauge.lightpath.net/de/dec217g.exe" + "http://www.bbti.us/download/windows/Broadband4PC_4_2_11.zip" + "http://www.aver.com/support/Drivers/AVerTVHD_MCE_A180_Drv_v1.2.2.16.zip" +) + + +SRC_URI="" +NEGATIVE_USE_FLAGS="" +ALL_URLS="" +NUMBER_OF_USE_FLAGS=0 + +for ((CARD=0; CARD < ${#PACKET_FW_NAMES[*]}; CARD++)) do + SRC_URI="${SRC_URI} dvb_cards_${PACKET_FW_NAMES[CARD]}? ( ${PACKET_SRC_URI} )" + + NEGATIVE_USE_FLAGS="${NEGATIVE_USE_FLAGS} !dvb_cards_${PACKET_FW_NAMES[CARD]}? ( " + NUMBER_OF_USE_FLAGS=$((NUMBER_OF_USE_FLAGS+1)) +done + +ALL_URLS="${ALL_URLS} ${PACKET_SRC_URI}" + + +for ((CARD=0; CARD < ${#FW_NAMES[*]}; CARD++)) do + URL="${FW_URLS[CARD]}" + + if [[ -z ${URL} ]]; then + echo "missing url for ${FW_NAMES[CARD]}" + continue + fi + SRC_URI="${SRC_URI} dvb_cards_${FW_NAMES[CARD]}? ( ${URL} )" + + NEGATIVE_USE_FLAGS="${NEGATIVE_USE_FLAGS} !dvb_cards_${FW_NAMES[CARD]}? ( " + NUMBER_OF_USE_FLAGS=$((NUMBER_OF_USE_FLAGS+1)) + ALL_URLS="${ALL_URLS} ${URL}" + # they all need unzip + DEPEND="${DEPEND} dvb_cards_${FW_NAMES[CARD]}? ( app-arch/unzip )" +done + + +SRC_URI="${SRC_URI} ${NEGATIVE_USE_FLAGS} ${ALL_URLS}" + +# add closing brackets for negative use flags +for ((NR=0; NR < ${NUMBER_OF_USE_FLAGS}; NR++)) do + SRC_URI="${SRC_URI} )" +done + + +install_dvb_card() { + [[ -z ${DVB_CARDS} ]] || use ${1} +} + +pkg_setup() { + if [[ -z ${DVB_CARDS} ]]; then + einfo "DVB_CARDS is not set, installing all available firmware files." + fi +} + +src_unpack() { + for f in ${A}; do + case ${f} in + dvb-firmwares-*) + unpack ${f} + ;; + *) + [[ -L ${f} ]] || ln -s ${DISTDIR}/${f} ${f} + esac + done + + + cp ${FILESDIR}/get_dvb_firmware-1 get_dvb_firmware + sed -i get_dvb_firmware \ + -e "s#/tmp#${T}#g" \ + + # firmwares which have to be downloaded seperately + for ((CARD=0; CARD < ${#FW_NAMES[*]}; CARD++)) do + install_dvb_card ${FW_NAMES[CARD]} || continue + + einfo "Extracting ${FW_NAMES[CARD]}" + ./get_dvb_firmware ${FW_NAMES[CARD]} + done +} + +src_install() { + insinto /lib/firmware + + # dvb-firmware packet from linuxtv + for ((CARD=0; CARD < ${#PACKET_FW_NAMES[*]}; CARD++)) do + if install_dvb_card ${PACKET_FW_NAMES[CARD]}; then + doins ${PACKET_FW_FILES[CARD]} + fi + done + + # firmwares which have to be downloaded seperately + for ((CARD=0; CARD < ${#FW_NAMES[*]}; CARD++)) do + if install_dvb_card ${FW_NAMES[CARD]}; then + doins ${FW_FILES[CARD]} + fi + done +} + diff --git a/media-tv/linuxtv-dvb-firmware/metadata.xml b/media-tv/linuxtv-dvb-firmware/metadata.xml new file mode 100644 index 000000000000..3aaff838ed8d --- /dev/null +++ b/media-tv/linuxtv-dvb-firmware/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>media-tv</herd> +<maintainer> +<email>zzam@gentoo.org</email> +<name>Matthias Schwarzott</name> +</maintainer> +<longdescription lang="en"> +</longdescription> +</pkgmetadata> + |