/[gentoo-x86]/media-video/vdr/vdr-1.6.0_p2-r5.ebuild
Gentoo

Contents of /media-video/vdr/vdr-1.6.0_p2-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sat Nov 12 13:22:02 2011 UTC (2 years, 9 months ago) by hd_brummy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
cleanup

(Portage version: 2.1.10.11/cvs/Linux i686, RepoMan options: --force)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/vdr/vdr-1.6.0_p2-r5.ebuild,v 1.4 2011/02/26 18:56:20 signals Exp $
4
5 inherit eutils flag-o-matic multilib
6
7 # Switches supported by extensions-patch
8 EXT_PATCH_FLAGS="analogtv atsc cmdsubmenu cutterlimit cutterqueue cuttime ddepgentry
9 dolbyinrec dvbplayer dvbsetup dvdarchive dvdchapjump graphtft hardlinkcutter
10 jumpplay lnbshare mainmenuhooks menuorg noepg osdmaxitems pinplugin
11 rotor settime setup sortrecords sourcecaps livebuffer
12 ttxtsubs timercmd timerinfo validinput yaepg
13 syncearly dvlfriendlyfnames dvlrecscriptaddon dvlvidprefer
14 volctrl wareagleicon lircsettings deltimeshiftrec em84xx
15 cmdreccmdi18n softosd parentalrating"
16
17 # names of the use-flags
18 EXT_PATCH_FLAGS_RENAMED="iptv liemikuutio"
19
20 # names ext-patch uses internally, here only used for maintainer checks
21 EXT_PATCH_FLAGS_RENAMED_EXT_NAME="pluginparam liemiext"
22
23 IUSE="vanilla dxr3 ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
24
25 MY_PV="${PV%_p*}"
26 MY_P="${PN}-${MY_PV}"
27 S="${WORKDIR}/${MY_P}"
28
29 EXT_V="72"
30 EXT_P=VDR-Extensions-Patch-${EXT_V}
31 EXT_DIR=${WORKDIR}/${EXT_P}/
32 EXT_VDR_PV="${PV/_p/-}"
33
34 DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
35 HOMEPAGE="http://www.tvdr.de/"
36 SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
37 ftp://ftp.tvdr.de/vdr/Developer/${MY_P}-1.diff
38 ftp://ftp.tvdr.de/vdr/Developer/${MY_P}-2.diff
39 http://www.zulu-entertainment.de/files/patches/${EXT_P}.tar.bz2"
40
41 KEYWORDS="amd64 ~ppc x86"
42 SLOT="0"
43 LICENSE="GPL-2"
44
45 COMMON_DEPEND="virtual/jpeg
46 sys-libs/libcap
47 >=media-libs/fontconfig-2.4.2
48 >=media-libs/freetype-2
49 sys-devel/gettext
50 dvdarchive? ( dvdchapjump? ( >=media-libs/libdvdread-4.1.3_p1168 ) )"
51
52 DEPEND="${COMMON_DEPEND}
53 media-tv/linuxtv-dvb-headers
54 dev-util/unifdef"
55
56 RDEPEND="${COMMON_DEPEND}
57 dev-lang/perl
58 >=media-tv/gentoo-vdr-scripts-0.4.5
59 media-fonts/corefonts"
60
61 # pull in vdr-setup to get the xml files, else menu will not work
62 PDEPEND="setup? ( >=media-plugins/vdr-setup-0.3.1-r1 )"
63
64 CONF_DIR=/etc/vdr
65 CAP_FILE=${S}/capabilities.sh
66 CAPS="# Capabilities of the vdr-executable for use by startscript etc."
67
68 pkg_setup() {
69 check_menu_flags
70
71 PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
72 }
73
74 check_menu_flags() {
75 if use menuorg && use setup; then
76 echo
77 eerror "Please use only one of this USE-Flags"
78 eerror "\tmenuorg setup"
79 die "multiple menu manipulation"
80 fi
81 }
82
83 add_cap() {
84 local arg
85 for arg; do
86 CAPS="${CAPS}\n${arg}=1"
87 done
88 }
89
90 enable_patch() {
91 local arg ARG_UPPER
92 for arg; do
93 ARG_UPPER=$(echo $arg|tr '[:lower:]' '[:upper:]')
94 echo "${ARG_UPPER} = 1" >> Make.config
95 done
96 }
97
98 extensions_add_make_conf()
99 {
100 # copy all ifdef for extensions-patch to Make.config
101 sed -e '1,/need to touch the following:/d' \
102 -e '/ifdef DVBDIR/,/^$/d' \
103 Make.config.template >> Make.config
104 }
105
106 extensions_all_defines() {
107 # extract all possible settings for extensions-patch
108 sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
109 Make.config.template \
110 | sort \
111 | tr '[:upper:]' '[:lower:]'
112 }
113
114 extensions_all_defines_unset() {
115 # extract all possible settings for extensions-patch
116 # and convert them to -U... for unifdef
117 sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?/-UUSE_/' -e 's/ .*//' \
118 Make.config.template \
119 | tr '\n' ' '
120 }
121
122 do_unifdef() {
123 ebegin "Unifdef sources"
124 local mf="Makefile.get"
125 cat <<'EOT' > $mf
126 include Makefile
127 show_def:
128 @echo $(DEFINES)
129 show_src_files:
130 @echo $(OBJS:%.o=%.c)
131 EOT
132
133 local DEFINES=$(extensions_all_defines_unset)
134
135 local RAW_DEFINES=$(make -f "$mf" show_def)
136 local VDR_SRC_FILES=$(make -f "$mf" show_src_files)
137 local KEEP_FILES=""
138 rm "$mf"
139
140 local def
141 for def in $RAW_DEFINES; do
142 case "${def}" in
143 -DUSE*)
144 DEFINES="${DEFINES} ${def}"
145 ;;
146 esac
147 done
148
149 local f
150 for f in *.c; do
151
152 # Removing the src files the Makefile does not use for compiling vdr
153 if ! has $f ${VDR_SRC_FILES} ${KEEP_FILES}; then
154 rm -f ${f} ${f%.c}.h
155 continue
156 fi
157
158 unifdef ${DEFINES} "$f" > "tmp.$f"
159 mv "tmp.$f" "$f"
160 done
161 for f in *.h; do
162 unifdef ${DEFINES} "$f" > "tmp.$f"
163 mv "tmp.$f" "$f"
164 [[ -s $f ]] || rm "$f"
165 done
166 eend 0
167 }
168
169 src_unpack() {
170
171 unpack ${A}
172
173 cd "${S}"
174 #applying maintainace-patches
175 epatch "${DISTDIR}/${MY_P}-1.diff"
176 epatch "${DISTDIR}/${MY_P}-2.diff"
177 epatch "${FILESDIR}"/vdr-dvb-api-5-is-fine.diff
178 epatch "${FILESDIR}"/vdr-1.6.0-ldflags.patch
179
180 ebegin "Changing pathes for gentoo"
181
182 sed \
183 -e 's-ConfigDirectory = VideoDirectory;-ConfigDirectory = CONFDIR;-' \
184 -i vdr.c
185
186 local DVBDIR=/usr/include
187
188 cat > Make.config <<-EOT
189 #
190 # Generated by ebuild ${PF}
191 #
192 PREFIX = /usr
193 DVBDIR = ${DVBDIR}
194 PLUGINLIBDIR = ${PLUGIN_LIBDIR}
195 CONFDIR = ${CONF_DIR}
196 VIDEODIR = /var/vdr/video
197 LOCDIR = \$(PREFIX)/share/vdr/locale
198
199 DEFINES += -DCONFDIR=\"\$(CONFDIR)\"
200 INCLUDES += -I\$(DVBDIR)
201
202 EOT
203 eend 0
204
205 epatch "${FILESDIR}"/vdr-1.6.0-makefile-install-header.diff
206
207 if use dxr3; then
208 einfo "Applying dxr3 subtitle hack"
209 epatch "${FILESDIR}"/vdr-1.6.0-dxr3-subtitlehack.diff
210 fi
211
212 sed -i i18n-to-gettext.pl \
213 -e '/MSGIDBUGS/s/""/"automatically created from i18n.c by vdr-plugin.eclass <vdr\\@gentoo.org>"/'
214
215 # Do not install runvdr script and plugins
216 sed -i Makefile \
217 -e 's/runvdr//' \
218 -e 's/ install-plugins//'
219
220 if use vanilla; then
221 epatch "${FILESDIR}"/vdr-1.6.0-gcc-4.4.diff
222 else
223
224 cd "${S}"
225 # Now apply extensions patch
226 local fname="${EXT_DIR}/${PN}-${EXT_VDR_PV:-${PV}}_extensions.diff"
227
228 epatch "${fname}"
229
230 # Fix typo in Make.config.template
231 sed -e 's/CMDRECMDI18N/CMDRECCMDI18N/' -i Make.config.template
232
233 # other gentoo patches
234 # epatch "${FILESDIR}/..."
235 epatch "${FILESDIR}"/vdr-1.6.0-gcc-4.4.diff
236 epatch "${FILESDIR}"/vdr-1.6.0-extensions-72-gcc-4.4.diff
237
238 # This allows us to start even if some plugin does not exist
239 # or is not loadable.
240 enable_patch PLUGINMISSING
241
242 # Patch necessary for media-plugins/vdr-reelchannelscan
243 # it does not change anything when plugin is not used
244 enable_patch CHANNELSCAN
245
246 if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
247 einfo "Doing maintainer checks:"
248
249 # these patches we do not support
250 # (or have them already hard enabled)
251 local IGNORE_PATCHES="channelscan pluginapi pluginmissing streamdevext"
252
253 extensions_all_defines > "${T}"/new.IUSE
254 echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
255 $IGNORE_PATCHES | \
256 tr ' ' '\n' |sort > "${T}"/old.IUSE
257 local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
258 if [[ -z ${DIFFS} ]]; then
259 einfo "EXT_PATCH_FLAGS is up to date."
260 else
261 ewarn "IUSE differences!"
262 local diff
263 for diff in $DIFFS; do
264 ewarn "$diff"
265 done
266 fi
267 fi
268
269 ebegin "Enabling selected patches"
270 local flag
271 for flag in $EXT_PATCH_FLAGS; do
272 use $flag && enable_patch ${flag}
273 done
274
275 # patches that got renamed
276 use iptv && enable_patch pluginparam
277 use liemikuutio && enable_patch liemiext
278 eend 0
279
280 extensions_add_make_conf
281
282 ebegin "Make depend"
283 emake .dependencies >/dev/null
284 eend $? "make depend failed"
285
286 [[ -z "$NO_UNIFDEF" ]] && do_unifdef
287
288 use iptv && sed -i sources.conf -e 's/^#P/P/'
289 fi
290
291 # apply local patches defined by variable VDR_LOCAL_PATCHES_DIR
292 if test -n "${VDR_LOCAL_PATCHES_DIR}"; then
293 local dir_tmp_var
294 local LOCALPATCHES_SUBDIR=${PV}
295 for dir_tmp_var in allversions-fallback ${PV%_p*} ${PV} ; do
296 if [[ -d ${VDR_LOCAL_PATCHES_DIR}/${dir_tmp_var} ]]; then
297 LOCALPATCHES_SUBDIR="${dir_tmp_var}"
298 fi
299 done
300
301 echo
302 if [[ ${LOCALPATCHES_SUBDIR} == ${PV} ]]; then
303 einfo "Applying local patches"
304 else
305 einfo "Applying local patches (Using subdirectory: ${LOCALPATCHES_SUBDIR})"
306 fi
307
308 for LOCALPATCH in ${VDR_LOCAL_PATCHES_DIR}/${LOCALPATCHES_SUBDIR}/*.{diff,patch}; do
309 test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}"
310 done
311 fi
312
313 if [[ -n "${VDRSOURCE_DIR}" ]]; then
314 cp -r "${S}" "${T}"/source-tree
315 fi
316
317 add_cap CAP_UTF8
318
319 add_cap CAP_IRCTRL_RUNTIME_PARAM \
320 CAP_VFAT_RUNTIME_PARAM \
321 CAP_CHUID \
322 CAP_SHUTDOWN_AUTO_RETRY
323
324 echo -e ${CAPS} > "${CAP_FILE}"
325 }
326
327 src_install() {
328 # trick makefile not to create a videodir by supplying it with an existing
329 # directory
330 emake install DESTDIR="${D}" VIDEODIR="/" || die "emake install failed"
331
332 keepdir "${CONF_DIR}"/plugins
333 keepdir "${CONF_DIR}"/themes
334
335 keepdir "${PLUGIN_LIBDIR}"
336
337 exeinto /usr/share/vdr/bin
338 doexe i18n-to-gettext.pl
339
340 dohtml *.html
341 dodoc MANUAL INSTALL README* HISTORY* CONTRIBUTORS
342
343 cd "${EXT_DIR}/docs" || die "Could not cd into extensions-patch doc dir."
344
345 local f
346 rm *vdr-1.4* 2>/dev/null
347 for f in *; do
348 [[ -f ${f} ]] || continue
349 newdoc "${f}" "${f}".ExtensionsPatch || die "Could not install extensions-patch doc ${f}"
350 done
351
352 cd "${S}"
353
354 insinto /usr/share/vdr
355 doins "${CAP_FILE}"
356
357 if [[ -n "${VDRSOURCE_DIR}" ]]; then
358 local SOURCES_DEST="${VDRSOURCE_DIR}/${P/_p/-}"
359 einfo "Installing sources"
360 insinto "${SOURCES_DEST}"
361 doins -r "${T}"/source-tree/*
362 keepdir "${SOURCES_DEST}"/PLUGINS/lib
363 fi
364
365 if use setup; then
366 insinto /usr/share/vdr/setup
367 doins "${S}"/menu.c
368 fi
369 chown -R vdr:vdr "${D}/${CONF_DIR}"
370 }
371
372 pkg_preinst() {
373 has_version "<${CATEGORY}/${PN}-1.3.36-r3"
374 previous_less_than_1_3_36_r3=$?
375
376 has_version "<${CATEGORY}/${PN}-1.6.0"
377 previous_less_than_1_6_0=$?
378 }
379
380 pkg_postinst() {
381 elog "It is a good idea to run vdrplugin-rebuild now."
382 if [[ $previous_less_than_1_3_36_r3 = 0 ]] ; then
383 ewarn "Upgrade Info:"
384 ewarn
385 ewarn "If you had used the use-flags lirc, rcu or vfat"
386 ewarn "then, you now have to enable the associated functionality"
387 ewarn "in /etc/conf.d/vdr"
388 ewarn
389 ewarn "vfat is now set with VFAT_FILENAMES."
390 ewarn "lirc/rcu are now set with IR_CTRL."
391 ebeep
392 fi
393
394 if use setup; then
395 if ! has_version media-plugins/vdr-setup || \
396 ! egrep -q '^setup$' "${ROOT}/etc/conf.d/vdr.plugins"; then
397
398 echo
399 ewarn "You have compiled media-video/vdr with USE=\"setup\""
400 ewarn "It is very important to emerge media-plugins/vdr-setup now!"
401 ewarn "and you have to loaded it in /etc/conf.d/vdr.plugins"
402 fi
403 fi
404
405 local keysfound=0
406 local key
407 local warn_keys="JumpFwd JumpRew JumpFwdSlow JumpRewSlow"
408 local remote_file="${ROOT}"/etc/vdr/remote.conf
409
410 if [[ -e ${remote_file} ]]; then
411 for key in ${warn_keys}; do
412 if grep -q -i "\.${key} " "${remote_file}"; then
413 keysfound=1
414 break
415 fi
416 done
417 if [[ ${keysfound} == 1 ]]; then
418 ewarn "Your /etc/vdr/remote.conf contains keys which are no longer usable"
419 ewarn "Please remove these keys or vdr will not start:"
420 ewarn "# ${warn_keys}"
421 fi
422 fi
423
424 if use atsc; then
425 ewarn "ATSC is only supported by a rudimentary patch"
426 einfo "and need at least this patch and a plugin installed"
427 einfo "emerge media-plugins/vdr-atscepg"
428 fi
429
430 if [[ $previous_less_than_1_6_0 = 0 ]]; then
431 elog "By default vdr is now started with utf8 character encoding"
432 elog
433 elog "To rename the old recordings to utf8 conforming names, do this:"
434 elog "\temerge app-text/convmv"
435 elog "\tconvmv -f latin1 -t utf8 -r --notest -i /var/vdr/video/"
436 elog
437 elog "To fix the descriptions of your recordings do this:"
438 elog "\tfind /var/vdr/video/ -name "info.vdr" -print0|xargs -0 recode latin1..utf8"
439 fi
440
441 elog "To get nice symbols in OSD we recommend to install"
442 elog "\t1. emerge media-fonts/vdrsymbols-ttf"
443 elog "\t2. select font VDRSymbolsSans in Setup"
444 elog ""
445 elog "To get an idea how to proceed now, have a look at our vdr-guide:"
446 elog "\thttp://www.gentoo.org/doc/en/vdr-guide.xml"
447 }

  ViewVC Help
Powered by ViewVC 1.1.20