]> CyberLeo.Net >> Repos - CDN/portage-cdn.git/blob - media-video/mplayer/mplayer-1.0_rc2_p27725-r2.ebuild
media-video/mplayer: add ASS patch
[CDN/portage-cdn.git] / media-video / mplayer / mplayer-1.0_rc2_p27725-r2.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_rc2_p27725-r1.ebuild,v 1.12 2008/12/13 22:29:35 bluebird Exp $
4
5 EAPI="1"
6
7 inherit eutils flag-o-matic multilib
8
9 # Ugly hack, feel free to fix
10 MPLAYER_REVISION=27725
11
12 IUSE="3dnow 3dnowext +a52 aac -aalib +alsa altivec amrnb amrwb -arts bidi bl
13 bindist cddb cdio cdparanoia -cpudetection -custom-cflags -custom-cpuopts debug
14 dga dirac doc dts dvb directfb +dvd dv dxr3 enca encode esd -fbcon ftp -gif ggi
15 -gtk iconv ipv6 jack joystick -jpeg kernel_linux ladspa -libcaca lirc live lzo
16 +mad -md5sum +mmx mmxext mp2 +mp3 musepack nas nemesi +vorbis opengl
17 openal oss -png -pnm pulseaudio -pvr quicktime radio -rar real rtc -samba schroedinger sdl
18 speex srt sse sse2 ssse3 svga teletext tga +theora +truetype unicode v4l v4l2 vidix win32codecs +X x264 xanim xinerama +xscreensaver +xv xvid xvmc zoran"
19
20 VIDEO_CARDS="s3virge mga tdfx vesa"
21
22 for x in ${VIDEO_CARDS}; do
23         IUSE="${IUSE} video_cards_${x}"
24 done
25
26 BLUV="1.7"
27 SVGV="1.9.17"
28 AMR_URI="http://www.3gpp.org/ftp/Specs/archive"
29 SRC_URI="mirror://gentoo/${P}.tar.bz2
30         !truetype? ( mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
31                                  mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
32                                  mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2 )
33         !iconv? ( mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
34                           mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
35                           mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2 )
36         gtk? ( mirror://mplayer/Skin/Blue-${BLUV}.tar.bz2 )
37         svga? ( http://mplayerhq.hu/~alex/svgalib_helper-${SVGV}-mplayer.tar.bz2 )"
38
39 DESCRIPTION="Media Player for Linux"
40 HOMEPAGE="http://www.mplayerhq.hu/"
41
42 RDEPEND="sys-libs/ncurses
43         !bindist? (
44                 x86? (
45                         win32codecs? ( media-libs/win32codecs )
46                         real? ( media-libs/win32codecs
47                                 media-video/realplayer )
48                         )
49                 amd64? ( real? ( media-libs/amd64codecs ) )
50         )
51         aalib? ( media-libs/aalib )
52         alsa? ( media-libs/alsa-lib )
53         amrnb? ( media-libs/amrnb )
54         amrwb? ( media-libs/amrwb )
55         arts? ( kde-base/arts )
56         openal? ( media-libs/openal )
57         bidi? ( dev-libs/fribidi )
58         cdio? ( dev-libs/libcdio )
59         cdparanoia? ( media-sound/cdparanoia )
60         dirac? ( >=media-video/dirac-0.10.0 )
61         directfb? ( dev-libs/DirectFB )
62         dga? ( x11-libs/libXxf86dga  )
63         dts? ( media-libs/libdca )
64         dv? ( media-libs/libdv )
65         dvb? ( media-tv/linuxtv-dvb-headers )
66         encode? (
67                 aac? ( media-libs/faac )
68                 mp2? ( media-sound/twolame )
69                 mp3? ( media-sound/lame )
70                 x264? ( >=media-libs/x264-0.0.20080406 )
71                 )
72         esd? ( media-sound/esound )
73         enca? ( app-i18n/enca )
74         gif? ( media-libs/giflib )
75         ggi? ( media-libs/libggi
76                 media-libs/libggiwmh )
77         gtk? ( media-libs/libpng
78                 x11-libs/libXxf86vm
79                 x11-libs/libXext
80                 x11-libs/libXi
81                 =x11-libs/gtk+-2* )
82         jpeg? ( media-libs/jpeg )
83         ladspa? ( media-libs/ladspa-sdk )
84         libcaca? ( media-libs/libcaca )
85         lirc? ( app-misc/lirc )
86         lzo? ( >=dev-libs/lzo-2 )
87         mad? ( media-libs/libmad )
88         musepack? ( >=media-libs/libmpcdec-1.2.2 )
89         nas? ( media-libs/nas )
90         opengl? ( virtual/opengl )
91         png? ( media-libs/libpng )
92         pnm? ( media-libs/netpbm )
93         pulseaudio? ( media-sound/pulseaudio )
94         samba? ( net-fs/samba )
95         schroedinger? ( media-libs/schroedinger )
96         sdl? ( media-libs/libsdl )
97         speex? ( >=media-libs/speex-1.1.7 )
98         srt? ( >=media-libs/freetype-2.1
99                 media-libs/fontconfig )
100         svga? ( media-libs/svgalib )
101         theora? ( media-libs/libtheora )
102         live? ( >=media-plugins/live-2007.02.20 )
103         truetype? ( >=media-libs/freetype-2.1
104                 media-libs/fontconfig )
105         vidix? ( x11-libs/libXxf86vm
106                          x11-libs/libXext )
107         xanim? ( media-video/xanim )
108         xinerama? ( x11-libs/libXinerama
109                 x11-libs/libXxf86vm
110                 x11-libs/libXext )
111         xscreensaver? ( x11-libs/libXScrnSaver )
112         xv? ( x11-libs/libXv
113                 x11-libs/libXxf86vm
114                 x11-libs/libXext
115                 xvmc? ( x11-libs/libXvMC ) )
116         xvid? ( media-libs/xvid )
117         X? ( x11-libs/libXxf86vm
118                 x11-libs/libXext
119         )"
120
121 DEPEND="${RDEPEND}
122         doc? ( >=app-text/docbook-sgml-dtd-4.1.2
123                 app-text/docbook-xml-dtd
124                 >=app-text/docbook-xml-simple-dtd-1.50.0
125                 dev-libs/libxslt )
126         dga? ( x11-proto/xf86dgaproto )
127         dxr3? ( media-video/em8300-libraries )
128         xinerama? ( x11-proto/xineramaproto )
129         xv? ( x11-proto/videoproto
130                   x11-proto/xf86vidmodeproto )
131         gtk? ( x11-proto/xextproto
132                    x11-proto/xf86vidmodeproto )
133         X? ( x11-proto/xextproto
134                  x11-proto/xf86vidmodeproto )
135         xscreensaver? ( x11-proto/scrnsaverproto )
136         iconv? ( virtual/libiconv )"
137 # Make sure the assembler USE flags are unmasked on amd64
138 # Remove this once default-linux/amd64/2006.1 is deprecated
139 DEPEND="${DEPEND} amd64? ( >=sys-apps/portage-2.1.2 )
140         mp2? ( >=sys-apps/portage-2.1.2 )"
141
142 SLOT="0"
143 LICENSE="GPL-2"
144 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
145
146 pkg_setup() {
147
148         if [[ -n ${LINGUAS} ]]; then
149                 elog ""
150                 elog "MPlayer's build system uses the LINGUAS variable for both"
151                 elog "output messages and which man pages to build.  The first"
152                 elog "language in the LINGUAS variable will be used to display"
153                 elog "output messages.  See bug #228799."
154         fi
155
156         if use gtk; then
157                 ewarn ""
158                 ewarn "You've enabled the 'gtk' use flag which will build"
159                 ewarn "GMPlayer, which is no longer actively developed upstream"
160                 ewarn "and is not supported by Gentoo.  There are alternatives"
161                 ewarn "for a GUI frontend: smplayer, gnome-mplayer and kmplayer."
162         fi
163
164         if use cpudetection; then
165                 ewarn ""
166                 ewarn "You've enabled the cpudetection flag.  This feature is"
167                 ewarn "included mainly for people who want to use the same"
168                 ewarn "binary on another system with a different CPU architecture."
169                 ewarn "MPlayer will already detect your CPU settings by default at"
170                 ewarn "buildtime; this flag is used for runtime detection."
171                 ewarn "You won't need this turned on if you are only building"
172                 ewarn "mplayer for this system.  Also, if your compile fails, try"
173                 ewarn "disabling this use flag."
174         fi
175
176         if use custom-cpuopts; then
177                 ewarn ""
178                 ewarn "You are using the custom-cpuopts flag which will"
179                 ewarn "specifically allow you to enable / disable certain"
180                 ewarn "CPU optimizations."
181                 ewarn ""
182                 ewarn "Most desktop users won't need this functionality, but it"
183                 ewarn "is included for corner cases like cross-compiling and"
184                 ewarn "certain profiles.  If unsure, disable this flag and MPlayer"
185                 ewarn "will automatically detect and use your available CPU"
186                 ewarn "optimizations."
187                 ewarn ""
188                 ewarn "Using this flag means your build is unsupported, so"
189                 ewarn "please make sure your CPU optimization use flags (3dnow"
190                 ewarn "3dnowext mmx mmxext sse sse2 ssse3) are properly set."
191         fi
192 }
193
194 src_unpack() {
195         unpack ${A}
196
197         if ! use truetype ; then
198                 unpack font-arial-iso-8859-1.tar.bz2 \
199                         font-arial-iso-8859-2.tar.bz2 \
200                         font-arial-cp1250.tar.bz2
201         fi
202
203         use gtk && unpack "Blue-${BLUV}.tar.bz2"
204
205         use svga && unpack "svgalib_helper-${SVGV}-mplayer.tar.bz2"
206
207         cd "${S}"
208
209         # Fix sparc compilation, bug 241110
210         epatch "${FILESDIR}/mplayer-libmpeg2.patch"
211         epatch "${FILESDIR}/mplayer-libavcodec.patch"
212
213         # Fix x264 compilation, bug 240347
214         epatch "${FILESDIR}/mplayer-1.0_rc2_p27725-libx264.patch"
215
216         # Add ASS support to mencoder
217         epatch "${FILESDIR}/mplayer-1.0_rc2_p27725-ass.patch"
218
219         # Set version #
220         sed -i s/UNKNOWN/${MPLAYER_REVISION}/ "${S}/version.sh"
221
222         # Fix hppa compilation
223         use hppa && sed -i -e "s/-O4/-O1/" "${S}/configure"
224
225         if use svga; then
226                 echo
227                 einfo "Enabling vidix non-root mode."
228                 einfo "(You need a proper svgalib_helper.o module for your kernel"
229                 einfo "to actually use this)"
230                 echo
231
232                 mv "${WORKDIR}/svgalib_helper" "${S}/libdha"
233         fi
234
235         # Fix polish spelling errors
236         [[ -n ${LINGUAS} ]] && sed -e 's:ZarzÄ\85dano:ZażÄ\85dano:' -i help/help_mp-pl.h
237 }
238
239 src_compile() {
240
241         local myconf=" --disable-tv-bsdbt848 \
242                 --disable-faad"
243
244         # broken upstream, won't work with recent kernels
245         myconf="${myconf} --disable-ivtv"
246
247         # MPlayer reads in the LINGUAS variable from make.conf, and sets
248         # the languages accordingly.  Some will have to be altered to match
249         # upstream's naming scheme.
250         [[ -n $LINGUAS ]] && LINGUAS=${LINGUAS/da/dk}
251
252         ################
253         #Optional features#
254         ###############
255         use bidi || myconf="${myconf} --disable-fribidi"
256         use bl && myconf="${myconf} --enable-bl"
257         use enca || myconf="${myconf} --disable-enca"
258         use encode || myconf="${myconf} --disable-mencoder"
259         use ftp || myconf="${myconf} --disable-ftp"
260         use nemesi || myconf="${myconf} --disable-nemesi"
261         use xscreensaver || myconf="${myconf} --disable-xss"
262
263         # libcdio support: prefer libcdio over cdparanoia
264         # don't check for cddb w/cdio
265         if use cdio; then
266                 myconf="${myconf} --disable-cdparanoia"
267         else
268                 myconf="${myconf} --disable-libcdio"
269                 use cdparanoia || myconf="${myconf} --disable-cdparanoia"
270                 use cddb || myconf="${myconf} --disable-cddb"
271         fi
272
273         # DVD support
274         # dvdread and libdvdcss are internal libs
275         # http://www.mplayerhq.hu/DOCS/HTML/en/dvd.html
276         # You can optionally use external dvdread support, but against
277         # upstream's suggestion.  We don't.
278         if ! use dvd; then
279                 myconf="${myconf} --disable-dvdnav --disable-dvdread"
280                 use a52 || myconf="${myconf} --disable-liba52 \
281                         --disable-liba52-internal"
282         fi
283
284         # SRT (subtitles) requires freetype support
285         # freetype support requires iconv
286         # iconv optionally can use unicode
287         if ! use srt; then
288                 myconf="${myconf} --disable-ass"
289                 if ! use truetype; then
290                         myconf="${myconf} --disable-freetype"
291                         if ! use iconv; then
292                                 myconf="${myconf} --disable-iconv --charset=noconv"
293                         fi
294                 fi
295         fi
296         use iconv && use unicode && myconf="${myconf} --charset=UTF-8"
297
298         use lirc || myconf="${myconf} --disable-lirc --disable-lircc"
299         myconf="${myconf} $(use_enable joystick)"
300         use ipv6 || myconf="${myconf} --disable-inet6"
301         use rar || myconf="${myconf} --disable-unrarexec"
302         use rtc || myconf="${myconf} --disable-rtc"
303         use samba || myconf="${myconf} --disable-smb"
304
305         # DVB / Video4Linux / Radio support
306         if { use dvb || use v4l || use v4l2 || use pvr || use radio; }; then
307                 use dvb || myconf="${myconf} --disable-dvb --disable-dvbhead"
308                 use pvr || myconf="${myconf} --disable-pvr"
309                 use v4l || myconf="${myconf} --disable-tv-v4l1"
310                 use v4l2 || myconf="${myconf} --disable-tv-v4l2"
311                 use teletext || myconf="${myconf} --disable-tv-teletext"
312                 if use radio && { use dvb || use v4l || use v4l2; }; then
313                         myconf="${myconf} --enable-radio $(use_enable encode radio-capture)"
314                 else
315                         myconf="${myconf} --disable-radio-v4l2 --disable-radio-bsdbt848"
316                 fi
317         else
318                 myconf="${myconf} --disable-tv --disable-tv-v4l1 --disable-tv-v4l2 \
319                         --disable-radio --disable-radio-v4l2 --disable-radio-bsdbt848 \
320                         --disable-dvb --disable-dvbhead --disable-tv-teletext \
321                         --disable-v4l2 --disable-pvr"
322         fi
323
324         #########
325         # Codecs #
326         ########
327         for x in gif jpeg live mad musepack pnm speex tga theora xanim; do
328                 use ${x} || myconf="${myconf} --disable-${x}"
329         done
330         for x in dirac schroedinger ; do
331                 use ${x} || myconf="${myconf} --disable-lib${x}-lavc"
332         done
333         use aac || myconf="${myconf} --disable-faac --disable-faac-lavc"
334         use amrnb || myconf="${myconf} --disable-libamr_nb"
335         use amrwb || myconf="${myconf} --disable-libamr_wb"
336         use dts || myconf="${myconf} --disable-libdca"
337         use dv || myconf="${myconf} --disable-libdv"
338         ! use png && ! use gtk && myconf="${myconf} --disable-png"
339         use lzo || myconf="${myconf} --disable-liblzo"
340         use encode && use mp2 || myconf="${myconf} --disable-twolame \
341                 --disable-toolame"
342         use mp3 || myconf="${myconf} --disable-mp3lame --disable-mp3lame-lavc"
343         use vorbis || myconf="${myconf} --disable-libvorbis"
344         use x264 || myconf="${myconf} --disable-x264 --disable-x264-lavc"
345         use xanim && myconf="${myconf} --xanimcodecsdir=/usr/lib/xanim/mods"
346         use xvid || myconf="${myconf} --disable-xvid --disable-xvid-lavc"
347
348         # Real codec support, only available on x86, amd64
349         if use real && use x86; then
350                 myconf="${myconf} --realcodecsdir=/opt/RealPlayer/codecs"
351         elif use real && use amd64; then
352                 myconf="${myconf} --realcodecsdir=/usr/$(get_libdir)/codecs"
353         else
354                 myconf="${myconf} --disable-real"
355         fi
356         if ! use bindist && ! use real; then
357                 myconf="${myconf} $(use_enable win32codecs win32dll)"
358         fi
359         # bug 213836
360         if ! use x86 || ! use win32codecs; then
361                 use quicktime || myconf="${myconf} --disable-qtx"
362         fi
363
364         #############
365         # Video Output #
366         #############
367         for x in directfb ggi md5sum sdl xinerama; do
368                 use ${x} || myconf="${myconf} --disable-${x}"
369         done
370         use aalib || myconf="${myconf} --disable-aa"
371         use dga || myconf="${myconf} --disable-dga1 --disable-dga2"
372         use fbcon || myconf="${myconf} --disable-fbdev"
373         use fbcon && use video_cards_s3virge && myconf="${myconf} --enable-s3fb"
374         use libcaca || myconf="${myconf} --disable-caca"
375         use opengl || myconf="${myconf} --disable-gl"
376         use video_cards_vesa || myconf="${myconf} --disable-vesa"
377         use vidix || myconf="${myconf} --disable-vidix \
378                 --disable-vidix-pcidb"
379         use zoran || myconf="${myconf} --disable-zr"
380
381         # MPlayer incorrectly looks for DXR3 support, so forcibly enable
382         # if requested. See bug 223587
383         myconf="${myconf} $(use_enable dxr3)"
384
385         # GTK gmplayer gui
386         myconf="${myconf} $(use_enable gtk gui)"
387
388         if use xv; then
389                 if use xvmc; then
390                         myconf="${myconf} --enable-xvmc --with-xvmclib=XvMCW"
391                 else
392                         myconf="${myconf} --disable-xvmc"
393                 fi
394         else
395                 myconf="${myconf} --disable-xv --disable-xvmc"
396         fi
397
398         if ! use kernel_linux && ! use video_cards_mga; then
399                  myconf="${myconf} --disable-mga --disable-xmga"
400         fi
401
402         if use video_cards_tdfx; then
403                 myconf="${myconf} $(use_enable video_cards_tdfx tdfxvid) \
404                         $(use_enable fbcon tdfxfb)"
405         else
406                 myconf="${myconf} --disable-3dfx --disable-tdfxvid --disable-tdfxfb"
407         fi
408
409         #############
410         # Audio Output #
411         #############
412         for x in alsa arts esd jack ladspa nas openal; do
413                 use ${x} || myconf="${myconf} --disable-${x}"
414         done
415         use pulseaudio || myconf="${myconf} --disable-pulse"
416         if ! use radio; then
417                 use oss || myconf="${myconf} --disable-ossaudio"
418         fi
419         #################
420         # Advanced Options #
421         #################
422         # Platform specific flags, hardcoded on amd64 (see below)
423         if use cpudetection || use bindist; then
424                 myconf="${myconf} --enable-runtime-cpudetection"
425         fi
426
427         # Turning off CPU optimizations usually will break the build.
428         # However, this use flag, if enabled, will allow users to completely
429         # specify which ones to use.  If disabled, mplayer will automatically
430         # enable all CPU optimizations that the host build supports.
431         if use custom-cpuopts; then
432                 for x in 3dnow 3dnowext mmx mmxext sse sse2 ssse3; do
433                         myconf="${myconf} $(use_enable $x)"
434                 done
435         fi
436
437         use debug && myconf="${myconf} --enable-debug=3"
438
439         myconf="${myconf} $(use_enable altivec)"
440
441         if use custom-cflags; then
442                 # let's play the filtration game!  MPlayer hates on all!
443                 strip-flags
444                 # ugly optimizations cause MPlayer to cry on x86 systems!
445                         if use x86 || use x86-fbsd ; then
446                                 replace-flags -O* -O2
447                                 filter-flags -fPIC -fPIE
448
449                                 use debug || append-flags -fomit-frame-pointer
450                         fi
451                 append-flags -D__STDC_LIMIT_MACROS
452         else
453                 unset CFLAGS CXXFLAGS
454         fi
455
456         myconf="--cc=$(tc-getCC) \
457                 --host-cc=$(tc-getBUILD_CC) \
458                 --prefix=/usr \
459                 --confdir=/etc/mplayer \
460                 --datadir=/usr/share/mplayer \
461                 --libdir=/usr/$(get_libdir) \
462                 --enable-menu \
463                 --enable-network \
464                 ${myconf}"
465         #echo "CFLAGS=\"${CFLAGS}\" ./configure ${myconf}"
466         CFLAGS="${CFLAGS}" ./configure ${myconf} || die "configure died"
467
468         emake || die "Failed to build MPlayer!"
469         use doc && make -C DOCS/xml html-chunked
470 }
471
472 src_install() {
473
474         make prefix="${D}/usr" \
475                  BINDIR="${D}/usr/bin" \
476                  LIBDIR="${D}/usr/$(get_libdir)" \
477                  CONFDIR="${D}/etc/mplayer" \
478                  DATADIR="${D}/usr/share/mplayer" \
479                  MANDIR="${D}/usr/share/man" \
480                  INSTALLSTRIP="" \
481                  install || die "Failed to install MPlayer!"
482
483         dodoc AUTHORS Changelog README etc/codecs.conf
484         # Install the documentation; DOCS is all mixed up not just html
485         if use doc ; then
486                 find "${S}/DOCS" -type d | xargs -- chmod 0755
487                 find "${S}/DOCS" -type f | xargs -- chmod 0644
488                 cp -r "${S}/DOCS" "${D}/usr/share/doc/${PF}/" || die "cp docs died"
489         fi
490
491         # Copy misc tools to documentation path, as they're not installed directly
492         # and yes, we are nuking the +x bit.
493         find "${S}/TOOLS" -type d | xargs -- chmod 0755
494         find "${S}/TOOLS" -type f | xargs -- chmod 0644
495         cp -r "${S}/TOOLS" "${D}/usr/share/doc/${PF}/" || die "cp docs died"
496
497         # Install the default Skin and Gnome menu entry
498         if use gtk; then
499                 dodir /usr/share/mplayer/skins
500                 cp -r "${WORKDIR}/Blue" \
501                         "${D}/usr/share/mplayer/skins/default" || die "cp skins died"
502
503                 # Fix the symlink
504                 rm -rf "${D}/usr/bin/gmplayer"
505                 dosym mplayer /usr/bin/gmplayer
506         fi
507
508         if ! use srt && ! use truetype; then
509                 dodir /usr/share/mplayer/fonts
510                 local x=
511                 # Do this generic, as the mplayer people like to change the structure
512                 # of their zips ...
513                 for x in $(find "${WORKDIR}/" -type d -name 'font-arial-*')
514                 do
515                         cp -pPR "${x}" "${D}/usr/share/mplayer/fonts"
516                 done
517                 # Fix the font symlink ...
518                 rm -rf "${D}/usr/share/mplayer/font"
519                 dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
520         fi
521
522         insinto /etc/mplayer
523         newins "${S}/etc/example.conf" mplayer.conf
524
525         if use srt || use truetype;     then
526                 cat >> "${D}/etc/mplayer/mplayer.conf" << EOT
527 fontconfig=1
528 subfont-osd-scale=4
529 subfont-text-scale=3
530 EOT
531         fi
532
533         dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
534
535         newbin "${S}/TOOLS/midentify.sh" midentify
536
537         insinto /usr/share/mplayer
538         doins "${S}/etc/input.conf"
539         doins "${S}/etc/menu.conf"
540 }
541
542 pkg_preinst() {
543
544         if [[ -d ${ROOT}/usr/share/mplayer/Skin/default ]]
545         then
546                 rm -rf "${ROOT}/usr/share/mplayer/Skin/default"
547         fi
548 }
549
550 pkg_postrm() {
551
552         # Cleanup stale symlinks
553         if [ -L "${ROOT}/usr/share/mplayer/font" -a \
554                  ! -e "${ROOT}/usr/share/mplayer/font" ]
555         then
556                 rm -f "${ROOT}/usr/share/mplayer/font"
557         fi
558
559         if [ -L "${ROOT}/usr/share/mplayer/subfont.ttf" -a \
560                  ! -e "${ROOT}/usr/share/mplayer/subfont.ttf" ]
561         then
562                 rm -f "${ROOT}/usr/share/mplayer/subfont.ttf"
563         fi
564 }