/[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.4 - (show annotations) (download)
Thu May 1 12:45:50 2014 UTC (6 years, 2 months ago) by ulm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -5 lines
Specify LICENSE more precisely, bug 445952.

(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!)

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

  ViewVC Help
Powered by ViewVC 1.1.20