/[gentoo-x86]/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-2009.09.19.ebuild
Gentoo

Contents of /media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-2009.09.19.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Jan 23 22:17:55 2012 UTC (2 years, 7 months ago) by ssuominen
Branch: MAIN
Changes since 1.2: +3 -3 lines
Missing app-arch/unrar DEPEND for Tevii_linuxdriver_0815.rar wrt #303187 by Anthony Bailey

(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-2009.09.19.ebuild,v 1.2 2009/11/12 18:18:55 billie Exp $
4
5 DESCRIPTION="Firmware files needed for operation of some dvb-devices"
6 HOMEPAGE="http://www.linuxtv.org"
7
8 LICENSE="as-is"
9 SLOT="0"
10 KEYWORDS="~amd64 ~x86"
11 IUSE=""
12
13 DEPEND="app-arch/unrar"
14 RDEPEND=""
15
16 RESTRICT="mirror"
17
18 S="${WORKDIR}"
19
20 # Files which can be fetched from linuxtv.org
21 PACKET_NAME=dvb-firmwares-1.tar.bz2
22 PACKET_SRC_URI="http://www.linuxtv.org/downloads/firmware/${PACKET_NAME}"
23 TEVII_NAME=Tevii_linuxdriver_0815.rar
24 TEVII_SRC_URI="http://tevii.com/${TEVII_NAME}"
25 get_dvb_firmware="${FILESDIR}/get_dvb_firmware-${PV}"
26 # from http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=history;f=Documentation/dvb/get_dvb_firmware
27
28 FW_USE_FLAGS=(
29 # packet
30 "usb-a800"
31 "dibusb-usb2"
32 "usb-dtt200u"
33 "usb-umt"
34 "usb-vp702x"
35 "usb-vp7045"
36 "usb-wt220u"
37 "dibusb-usb1"
38 "or51211"
39 "or51132"
40 "or51132"
41 "usb-dw2104"
42 "usb-dw2104"
43 # own URL
44 "ttpci"
45 "bcm3510"
46 "usb-wt220u"
47 "usb-wt220u"
48 "usb-dib0700"
49 "sp887x"
50 "af9005"
51 "cx231xx"
52 "cx18"
53 "cx18"
54 "cx18"
55 "cx23885"
56 "cx23885"
57 "pvrusb2"
58 "usb-bluebird"
59 "tda10045"
60 # get_dvb_firmware
61 "sp8870"
62 "tda10046"
63 "tda10046lifeview"
64 "ttusb-dec"
65 "ttusb-dec"
66 "ttusb-dec"
67 "opera1"
68 "opera1"
69 "vp7041"
70 "nxt200x"
71 "mpc718"
72 "usb-af9015"
73 )
74
75 FW_FILES=(
76 # packet
77 "dvb-usb-avertv-a800-02.fw"
78 "dvb-usb-dibusb-6.0.0.8.fw"
79 "dvb-usb-dtt200u-01.fw"
80 "dvb-usb-umt-010-02.fw"
81 "dvb-usb-vp702x-01.fw"
82 "dvb-usb-vp7045-01.fw"
83 "dvb-usb-wt220u-01.fw"
84 "dvb-usb-dibusb-5.0.0.11.fw"
85 "dvb-fe-or51211.fw"
86 "dvb-fe-or51132-qam.fw"
87 "dvb-fe-or51132-vsb.fw"
88 "dvb-usb-dw2104.fw"
89 "dvb-fe-cx24116.fw"
90 # own URL
91 "dvb-ttpci-01.fw"
92 "dvb-fe-bcm3510-01.fw"
93 "dvb-usb-wt220u-02.fw"
94 "dvb-usb-wt220u-fc03.fw"
95 "dvb-usb-dib0700-1.20.fw"
96 "dvb-fe-sp887x.fw"
97 "af9005.fw"
98 "v4l-cx231xx-avcore-01.fw"
99 "v4l-cx23418-apu.fw"
100 "v4l-cx23418-cpu.fw"
101 "v4l-cx23418-dig.fw"
102 "v4l-cx23885-avcore-01.fw"
103 "v4l-cx23885-enc.fw"
104 "v4l-cx25840.fw"
105 "dvb-usb-bluebird-01.fw"
106 "dvb-fe-tda10045.fw"
107 # get_dvb_firmware
108 "dvb-fe-sp8870.fw"
109 "dvb-fe-tda10046.fw"
110 "dvb-fe-tda10046.fw"
111 "dvb-ttusb-dec-2000t.fw"
112 "dvb-ttusb-dec-2540t.fw"
113 "dvb-ttusb-dec-3000s.fw"
114 "dvb-usb-opera1-fpga-01.fw"
115 "dvb-usb-opera-01.fw"
116 "dvb-vp7041-2.422.fw"
117 "dvb-fe-nxt2004.fw"
118 "dvb-cx18-mpc718-mt352.fw"
119 "dvb-usb-af9015.fw"
120 )
121
122 FW_GET_PARAMETER=(
123 # packet
124 "-"
125 "-"
126 "-"
127 "-"
128 "-"
129 "-"
130 "-"
131 "-"
132 "-"
133 "-"
134 "-"
135 "-"
136 "-"
137 # own URL
138 "-"
139 "-"
140 "-"
141 "-"
142 "-"
143 "-"
144 "-"
145 "-"
146 "-"
147 "-"
148 "-"
149 "-"
150 "-"
151 "-"
152 "-"
153 "-"
154 # get_dvb_firmware
155 "sp8870"
156 "tda10046"
157 "tda10046lifeview"
158 "dec2000t"
159 "dec2540t"
160 "dec3000s"
161 "opera1"
162 "-"
163 "vp7041"
164 "nxt2004"
165 "mpc718"
166 "af9015"
167 )
168
169 FW_URLS=(
170 # packet
171 "${PACKET_SRC_URI}"
172 "${PACKET_SRC_URI}"
173 "${PACKET_SRC_URI}"
174 "${PACKET_SRC_URI}"
175 "${PACKET_SRC_URI}"
176 "${PACKET_SRC_URI}"
177 "${PACKET_SRC_URI}"
178 "${PACKET_SRC_URI}"
179 "${PACKET_SRC_URI}"
180 "${PACKET_SRC_URI}"
181 "${PACKET_SRC_URI}"
182 "${TEVII_SRC_URI}"
183 "${TEVII_SRC_URI}"
184 # own URL
185 "http://www.escape-edv.de/endriss/firmware/dvb-ttpci-01.fw-fc2624"
186 "http://www.linuxtv.org/downloads/firmware/dvb-fe-bcm3510-01.fw"
187 "http://www.linuxtv.org/downloads/firmware/dvb-usb-wt220u-02.fw"
188 "http://home.arcor.de/efocht/dvb-usb-wt220u-fc03.fw"
189 "http://www.wi-bw.tfh-wildau.de/~pboettch/home/files/dvb-usb-dib0700-1.20.fw"
190 "http://peterdamen.com/dvb-fe-sp887x.fw"
191 "http://ventoso.org/luca/af9005/af9005.fw"
192 "http://linuxtv.org/downloads/firmware/v4l-cx231xx-avcore-01.fw"
193 "http://linuxtv.org/downloads/firmware/v4l-cx23418-apu.fw"
194 "http://linuxtv.org/downloads/firmware/v4l-cx23418-cpu.fw"
195 "http://linuxtv.org/downloads/firmware/v4l-cx23418-dig.fw"
196 "http://linuxtv.org/downloads/firmware/v4l-cx23885-avcore-01.fw"
197 "http://linuxtv.org/downloads/firmware/v4l-cx23885-enc.fw"
198 "http://linuxtv.org/downloads/firmware/v4l-cx25840.fw"
199 "http://linuxtv.org/downloads/firmware/dvb-usb-bluebird-01.fw"
200 "http://www.fireburn.co.uk/dvb-fe-tda10045.fw"
201 # get_dvb_firmware
202 "http://2.download.softwarepatch.pl/1619edb0dcb493dd5337b94a1f79c3f6/tt_Premium_217g.zip"
203 "http://www.tt-download.com/download/updates/219/TT_PCI_2.19h_28_11_2006.zip"
204 "http://www.lifeview.hk/dbimages/document/7%5Cdrv_2.11.02.zip"
205 "http://hauppauge.lightpath.net/de/dec217g.exe"
206 "http://hauppauge.lightpath.net/de/dec217g.exe"
207 "http://hauppauge.lightpath.net/de/dec217g.exe"
208 "http://www.informatik.uni-leipzig.de/~hlawit/dvb/2830SCap2.sys"
209 "http://www.informatik.uni-leipzig.de/~hlawit/dvb/2830SLoad2.sys"
210 "http://www.twinhan.com/files/AW/Software/TwinhanDTV2.608a.zip"
211 "http://www.avermedia-usa.com/support/Drivers/AVerTVHD_MCE_A180_Drv_v1.2.2.16.zip"
212 "ftp://ftp.work.acer-euro.com/desktop/aspire_idea510/vista/Drivers/Yuan%20MPC718%20TV%20Tuner%20Card%202.13.10.1016.zip"
213 "http://www.ite.com.tw/EN/Services/download.ashx?file=57"
214 )
215
216 SRC_URI=""
217 NEGATIVE_USE_FLAGS=""
218 NEGATIVE_END_BRACKETS=""
219 ALL_URLS=""
220
221 for ((CARD=0; CARD < ${#FW_USE_FLAGS[*]}; CARD++)) do
222 URL="${FW_URLS[CARD]}"
223
224 if [[ -z ${URL} ]]; then
225 echo "missing url for ${FW_USE_FLAGS[CARD]}"
226 continue
227 fi
228 SRC_URI="${SRC_URI} dvb_cards_${FW_USE_FLAGS[CARD]}? ( ${URL} )"
229
230 IUSE="${IUSE} dvb_cards_${FW_USE_FLAGS[CARD]}"
231 NEGATIVE_USE_FLAGS="${NEGATIVE_USE_FLAGS} !dvb_cards_${FW_USE_FLAGS[CARD]}? ( "
232 NEGATIVE_END_BRACKETS="${NEGATIVE_END_BRACKETS} )"
233 ALL_URLS="${ALL_URLS} ${URL}"
234
235 GET_PARAM="${FW_GET_PARAMETER[CARD]}"
236 if [[ ${GET_PARAM} != "-" ]]; then
237 # all firmwares extracted by get_dvb_firmware need unzip
238 DEPEND="${DEPEND} dvb_cards_${FW_USE_FLAGS[CARD]}? ( app-arch/unzip )"
239 fi
240 done
241
242 SRC_URI="${SRC_URI} ${NEGATIVE_USE_FLAGS} ${ALL_URLS} ${NEGATIVE_END_BRACKETS}"
243
244 DEPEND="${DEPEND}
245 ${NEGATIVE_USE_FLAGS}
246 app-arch/unzip
247 ${NEGATIVE_END_BRACKETS}"
248
249 install_dvb_card() {
250 if [[ -z ${DVB_CARDS} ]]; then
251 # install (almost) all firmware files
252 # do not install this one due to conflicting filenames
253 [[ "${1}" != "tda10046lifeview" ]]
254 else
255 # Check if this flag is set
256 use dvb_cards_${1}
257 fi
258 }
259
260 pkg_setup() {
261 #echo SRC_URI=${SRC_URI}
262 #echo DEPEND=${DEPEND}
263 if has tda1004x ${DVB_CARDS}; then
264 eerror
265 eerror "DVB_CARDS flag tda1004x has been split into"
266 eerror "tda10045, tda10046 and tda10046lifeview".
267 eerror
268 eerror "But beware that you cannot enable tda10046 and"
269 eerror "tda10046lifeview at the same time."
270 fi
271
272 if [[ -z ${DVB_CARDS} ]]; then
273 elog
274 elog "DVB_CARDS is not set, installing all available firmware files."
275 elog "To save bandwidth please consider setting the DVB_CARDS variable"
276 elog "in ${ROOT%/}/etc/make.conf. This way only the firmwares you own"
277 elog "the hardware will be installed."
278 fi
279 # according to http://devmanual.gentoo.org/general-concepts/use-flags/index.html
280 # we should not die here. However, there is no sensible fallback choice to make
281 # because the user may have either the one or the other. WYGIWYG
282 if use dvb_cards_tda10046 && use dvb_cards_tda10046lifeview; then
283 eerror
284 eerror "You cannot have both tda10046 and tda10046lifeview in DVB_CARDS"
285 eerror "because of colliding firmware filenames (dvb-fe-tda10046.fw)."
286 eerror "Sorry."
287 die "Conflicting values for DVB_CARDS set."
288 fi
289 elog
290 elog "List of possible card-names to use for DVB_CARDS:"
291 echo ${FW_USE_FLAGS[*]}| tr ' ' '\n' | sort | uniq | fmt \
292 | while read line; do
293 elog " ${line}"
294 done
295 elog
296 elog "If you need another firmware file and want it included create a bug"
297 elog "at bugs.gentoo.org."
298 elog "In case some firmware sources are not fetchable please try again at"
299 elog "a later time and if it still does not fetch report a bug. If there"
300 elog "is no alternative source or an update to the firmware available we"
301 elog "have to remove it from the ebuild and you are on your own."
302 }
303
304 src_unpack() {
305 local distfile
306
307 # link all downloaded files to ${S}
308 for distfile in ${A}; do
309 [[ -L ${distfile} ]] || ln -s ${DISTDIR}/${distfile} ${distfile}
310 done
311
312 # unpack firmware-packet
313 if has ${PACKET_NAME} ${A}; then
314 unpack ${PACKET_NAME}
315 fi
316
317 # unpack tevii packet
318 if has ${TEVII_NAME} ${A}; then
319 unpack ${TEVII_NAME}
320 fi
321
322 if [[ -z ${DVB_CARDS} ]] || use dvb_cards_mpc718 ; then
323 mv Yuan%20MPC718%20TV%20Tuner%20Card%202.13.10.1016.zip "Yuan MPC718 TV Tuner Card 2.13.10.1016.zip"
324 fi
325 if [[ -z ${DVB_CARDS} ]] || use dvb_cards_ttpci ; then
326 mv dvb-ttpci-01.fw-fc2624 dvb-ttpci-01.fw
327 fi
328
329 if [[ -z ${DVB_CARDS} ]] || use dvb_cards_usb-dw2104 ; then
330 mv tevii_linuxdriver_0815/fw/dvb-usb-s650.fw dvb-usb-dw2104.fw
331 mv tevii_linuxdriver_0815/fw/dvb-fe-cx24116.fw ./
332 fi
333
334 local script_v=${PV}
335
336 # Adjust temp-dir of get_dvb_firmware
337 sed "${FILESDIR}"/get_dvb_firmware-${script_v} \
338 -e "s#/tmp#${T}#g" > get_dvb_firmware
339 chmod a+x get_dvb_firmware
340
341 # extract the firmware-files
342 for ((CARD=0; CARD < ${#FW_USE_FLAGS[*]}; CARD++)) do
343 install_dvb_card ${FW_USE_FLAGS[CARD]} || continue
344
345 GET_PARAM=${FW_GET_PARAMETER[CARD]}
346 if [[ ${GET_PARAM} != "-" ]]; then
347 [[ -f ${FW_FILES[CARD]} ]] && ewarn "Already existing: ${FW_FILES[CARD]}"
348 elog "Extracting ${FW_FILES[CARD]}"
349 ./get_dvb_firmware ${GET_PARAM}
350 fi
351 done
352 }
353
354 src_install() {
355 insinto /lib/firmware
356
357 for ((CARD=0; CARD < ${#FW_USE_FLAGS[*]}; CARD++)) do
358 if install_dvb_card ${FW_USE_FLAGS[CARD]}; then
359 local file=${FW_FILES[CARD]}
360 [[ -f ${file} ]] || die "File ${file} does not exist!"
361 doins ${file}
362 fi
363 done
364 }

  ViewVC Help
Powered by ViewVC 1.1.20