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

Contents of /media-tv/linuxtv-dvb-firmware/linuxtv-dvb-firmware-2009.07.06-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Sep 10 17:56:50 2009 UTC (5 years, 4 months ago) by billie
Branch: MAIN
Changes since 1.2: +26 -16 lines
Fix installation of some firmwares if DVB_CARDS is unset. This fixes bug #284162. Ebuild cleanup.
(Portage version: 2.1.6.13/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20