Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 9ecff4e7e2432b1fec19a07fda6a4797 > files > 16

mplayer-vaapi-1.0-1.rc4.0.20100414.1mdv2010.1.src.rpm

%define build_3264bit     0
%{?_with_3264bit: %{expand: %%global build_3264bit 1}}
%{?_without_3264bit: %{expand: %%global build_3264bit 0}}
%if %{build_3264bit}
%define	pkgext	32
%else
%define pkgext	%{nil}
%endif

%define pkgsuffix -vaapi
%define Name		mplayer%{pkgsuffix}

%define name		%{Name}%{pkgext}
%define Summary		Movie player for linux
%define prerel		rc4
%define version 1.0
%define fversion %svn
%define svn 20100414
%if %svn
%define rel		1.%prerel.0.%svn.1
%else 
%define rel 1.%prerel.2
%endif
%define release		%mkrel %rel

%define build_plf 0
%define build_optimization 0
%define build_debug 0
%define build_mencoder 1
%define build_gui 1

%define kernel_version	%(/bin/bash %{SOURCE5})
%define kver 		%(/bin/bash %{SOURCE5} | sed -e 's/-/./')
%define kvername	%(/bin/bash %{SOURCE5} | sed -e 's/-/./' | sed -e 's/mdk//')

%define build_yasm	1
%define build_live	1
%define build_vesa	1
%define build_theora	1
%define build_ggi	0
%define build_lirc	1
%define	build_xmms	0
%define build_amr	0
%define	build_arts	0
%define build_aa	1
%define build_cdda	1
%define build_compiz	0
%define build_dirac	1
%define build_dv	1
%define build_sdl	1
%define build_lzo	1
%define build_smb	1
%define build_mga	1
%define build_fbdev	1
%define build_dvb	1
%define build_fribidi	1
%define build_enca	1
%define build_alsa	1
%define build_jack	1
%define build_openal	0
%define build_pulse	1
%define build_schroedinger	1
%define build_twolame 0
%define build_lame 0
%define build_faac 0
%define build_faad 0
%define build_x264 0
%define build_xvid 0
%define build_dts 0
%define build_directfb 1
%define build_v4l2 1
%define build_xvmc 1
%define build_vaapi 1
%define build_vdpau 0
%define build_ivtv 0


%if %mdkversion < 920
%define build_smb 0
%define build_jack 0
%endif

%if %mdkversion < 1000
%define build_openal 0
%define build_theora 0
%define build_directfb 0
%endif

%if %mdkversion < 1020
%define build_v4l2	0
%endif

%if %mdkversion < 200700
%define build_pulse	0
%endif

%if %mdvver < 200900
%define build_ivtv 1
%define build_vdpau 0
%endif

%if %mdvver <= 200900
# gw these were not in main before 2009.1
%define build_dirac 0
%define build_schroedinger 0
%define build_yasm 0
%endif

%if %mdkversion >= 200900
%define build_smb       0
%endif

%ifnarch %ix86
%define build_vesa 0
%endif

%{?_with_plf: %{expand: %%global build_plf 1}}
%if %build_plf
%define distsuffix plf
%define build_amr 1
%define build_twolame 1
%define build_lame 1
%define build_faac 1
%define build_faad 1
%define build_x264 1
%define build_xvid 1
%define build_dts 1
%define build_yasm 1
%if %mdvver >= 200900
%define build_dirac 1
%define build_schroedinger 1
%endif
%endif

%{?_with_amr: %{expand: %%global build_amr 1}}
%{?_without_amr: %{expand: %%global build_amr 0}}
%{?_with_live: %{expand: %%global build_live 1}}
%{?_without_live: %{expand: %%global build_live 0}}
%{?_with_yasm: %{expand: %%global build_yasm 1}}
%{?_without_yasm: %{expand: %%global build_yasm 0}}
%{?_with_vesa: %{expand: %%global build_vesa 1}}
%{?_without_vesa: %{expand: %%global build_vesa 0}}
%{?_with_optimization: %{expand: %%global build_optimization 1}}
%{?_with_debug: %{expand: %%global build_debug 1}}
%{?_without_debug: %{expand: %%global build_debug 0}}
%{?_with_mencoder: %{expand: %%global build_mencoder 1}}
%{?_without_mencoder: %{expand: %%global build_mencoder 0}}
%{?_with_gui: %{expand: %%global build_gui 1}}
%{?_without_gui: %{expand: %%global build_gui 0}}
%{?_with_theora: %{expand: %%global build_theora 1}}
%{?_without_theora: %{expand: %%global build_theora 0}}
%{?_with_smb: %{expand: %%global build_smb 1}}
%{?_without_smb: %{expand: %%global build_smb 0}}
%{?_with_ggi: %{expand: %%global build_ggi 1}}
%{?_without_ggi: %{expand: %%global build_ggi 0}}
%{?_with_lirc: %{expand: %%global build_lirc 1}}
%{?_without_lirc: %{expand: %%global build_lirc 0}}
%{?_with_xmms: %{expand: %%global build_xmms 1}}
%{?_without_xmms: %{expand: %%global build_xmms 0}}
%{?_with_arts: %{expand: %%global build_arts 1}}
%{?_without_arts: %{expand: %%global build_arts 0}}
%{?_with_aa: %{expand: %%global build_aa 1}}
%{?_without_aa: %{expand: %%global build_aa 0}}
%{?_with_cdda: %{expand: %%global build_cdda 1}}
%{?_without_cdda: %{expand: %%global build_cdda 0}}
%{?_with_dirac: %{expand: %%global build_dirac 1}}
%{?_without_dirac: %{expand: %%global build_dirac 0}}
%{?_with_dv: %{expand: %%global build_dv 1}}
%{?_without_dv: %{expand: %%global build_dv 0}}
%{?_with_sdl: %{expand: %%global build_sdl 1}}
%{?_without_sdl: %{expand: %%global build_sdl 0}}
%{?_with_lzo: %{expand: %%global build_lzo 1}}
%{?_without_lzo: %{expand: %%global build_lzo 0}}
%{?_with_mga: %{expand: %%global build_mga 1}}
%{?_without_mga: %{expand: %%global build_mga 0}}
%{?_with_fribidi: %{expand: %%global build_fribidi 1}}
%{?_without_fribidi: %{expand: %%global build_fribidi 0}}
%{?_with_enca: %{expand: %%global build_enca 1}}
%{?_without_enca: %{expand: %%global build_enca 0}}
%{?_with_jack: %{expand: %%global build_jack 1}}
%{?_without_jack: %{expand: %%global build_jack 0}}
%{?_with_pulse: %{expand: %%global build_pulse 1}}
%{?_without_pulse: %{expand: %%global build_pulse 0}}
%{?_with_openal: %{expand: %%global build_openal 1}}
%{?_without_openal: %{expand: %%global build_openal 0}}
%{?_with_schroedinger: %{expand: %%global build_schroedinger 1}}
%{?_without_schroedinger: %{expand: %%global build_schroedinger 0}}
%{?_with_twolame: %{expand: %%global build_twolame 1}}
%{?_without_twolame: %{expand: %%global build_twolame 0}}
%{?_with_lame: %{expand: %%global build_lame 1}}
%{?_without_lame: %{expand: %%global build_lame 0}}
%{?_with_faac: %{expand: %%global build_faac 1}}
%{?_without_faac: %{expand: %%global build_faac 0}}
%{?_with_faad: %{expand: %%global build_faad 1}}
%{?_without_faad: %{expand: %%global build_faad 0}}
%{?_with_x264: %{expand: %%global build_x264 1}}
%{?_without_x264: %{expand: %%global build_x264 0}}
%{?_with_xvid: %{expand: %%global build_xvid 1}}
%{?_without_xvid: %{expand: %%global build_xvid 0}}
%{?_with_dts: %{expand: %%global build_dts 1}}
%{?_without_dts: %{expand: %%global build_dts 0}}
%{?_with_directfb: %{expand: %%global build_directfb 1}}
%{?_without_directfb: %{expand: %%global build_directfb 0}}
%{?_with_v4l2: %{expand: %%global build_v4l2 1}}
%{?_without_v4l2: %{expand: %%global build_v4l2 0}}
%{?_with_xvmc: %{expand: %%global build_xvmc 1}}
%{?_without_xvmc: %{expand: %%global build_xvmc 0}}
%{?_with_vdpau: %{expand: %%global build_vdpau 1}}
%{?_without_vdpau: %{expand: %%global build_vdpau 0}}

Name:		%{name}
Version:	%{version}
Release:	%{release}
Summary:	%{Summary}
%if %svn
Source0:	%{name}-%{svn}-FULL.tar.bz2
%else
Source0:	%{Name}-%{fversion}.tar.bz2
%endif
#gw default skin
Source4:	Blue-1.5.tar.bz2
Source5:	kernel-version.sh
Patch0:		mplayer-mdvconfig.patch
Patch3:		mplayer-mp3lib-no-strict-aliasing.patch
Patch7:		mplayer-1.0pre1-nomgafirst.patch
Patch12:	mplayer-desktopentry.patch
Patch21:	mplayer-1.0rc2-compiz.patch
#gw official security fixes:
Patch26:	mplayer-1.0rc2-fribidi-0.19.patch
# fixes for crashes found while fixing CVE-2008-1558
Patch28:	mplayer-rtsp-extra-fixes.patch
Patch31:       mplayer-format-string-literal.patch
#gw HAVE_DLFCN_H isn't defined
Patch33:       mplayer-have-dlfcn_h.patch
#gw fix crash: https://qa.mandriva.com/show_bug.cgi?id=55443
Patch35: mplayer-fix-dvd-crash.patch
Patch36: mplayer-fix-gif-check.patch
# (blino) vaapi fixes
Patch100: mplayer-vaapi-20100224-linkva.patch
URL:		http://www.mplayerhq.hu
License:	GPLv2
Group:		Video
%if %build_dvb && %mdkversion < 1000
BuildRequires:  kernel-source
%endif
BuildRequires:	libncurses-devel
%if %build_aa
BuildRequires:	libaa-devel
%endif
BuildRequires:  a52dec-devel
%if %build_arts
BuildRequires:  libarts-devel
%endif
%if %build_amr
BuildRequires:  opencore-amr-devel
%endif

%if %build_jack
BuildRequires:  libjack-devel
%endif
%if %build_pulse
BuildRequires:  libpulseaudio-devel
%endif
%if %build_openal
BuildRequires:  libopenal-devel
%endif
%if %build_cdda
BuildRequires:	libcdda-devel
%endif
%if %build_dirac
BuildRequires:	libdirac-devel >= 0.9.0
%endif
%if %build_schroedinger
BuildRequires:	libschroedinger-devel
%endif
%if %build_dv
BuildRequires:	libdv-devel
%endif
BuildRequires:	libdxr3-devel
BuildRequires:	libesound-devel
BuildRequires:	libjpeg-devel
BuildRequires:	openjpeg-devel
%if %build_lirc
BuildRequires:	liblirc-devel
%endif
%if %build_lzo
BuildRequires:	liblzo-devel
%endif
BuildRequires:  libmad-devel
BuildRequires:  libnas-devel
BuildRequires:	libpng-devel
%if %build_sdl
BuildRequires:	libSDL-devel >= 1.1.8
%endif
BuildRequires:	libtermcap-devel
%if %build_xmms
BuildRequires:  libxmms-devel
%endif
%if %build_ggi
BuildRequires:	libggiwmh-devel
%endif
%if %build_smb
# require samba < 3.2.0 to avoid shipping GPLv2 vs GPLv3
BuildRequires:	libsmbclient-devel < 3.2.0
%endif
%if %build_twolame
BuildRequires:	libtwolame-devel
%endif
%if %build_faac
BuildRequires:	libfaac-devel
%endif
%if %build_faad
BuildRequires: libfaad2-devel
%endif
%if %build_x264
BuildRequires:	libx264-devel
%endif
%if %build_xvid
BuildRequires:	xvid-devel >= 1.0.0-0.beta2.1plf
%endif
%if %build_dts
BuildRequires: dtsdec-devel
%endif
%if %build_lame
BuildRequires: liblame-devel
%endif
%if %build_plf
Requires: %mklibname dvdcss 2
%endif
%if %build_live
BuildRequires: live-devel
%endif
%if %build_vesa
BuildRequires: libvbe-devel liblrmi-devel
%endif
%if %build_theora
BuildRequires: libtheora-devel
%endif
%if %build_fribidi
BuildRequires: libfribidi-devel >= 0.10.4
%endif
%if %build_enca
BuildRequires: libenca-devel
%endif
%if %build_directfb
BuildRequires: libdirectfb-devel
%endif
%if %build_xvmc
BuildRequires: libxvmc-devel
%endif
%if %build_vdpau
BuildRequires: vdpau-devel
%endif
%if %build_vaapi
BuildRequires: libva-devel
%endif
BuildRequires: bzip2-devel
BuildRequires: libmng-devel
BuildRequires: libmesagl-devel
BuildRequires: libxxf86vm-devel
BuildRequires: libxxf86dga-devel
BuildRequires: libxscrnsaver-devel
BuildRequires: libspeex-devel
BuildRequires: libmpcdec-devel
BuildRequires: ladspa-devel
BuildRequires: libxslt-proc
BuildRequires: docbook-style-xsl
BuildRequires: docbook-dtd412-xml
BuildRequires: libcaca-devel
%if %mdvver >= 201010
BuildRequires: giflib-devel
%else
BuildRequires: ungif-devel
%endif
%if %build_yasm
BuildRequires: yasm
%endif
BuildRequires: libbs2b-devel

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Conflicts:	mplayer

%description
MPlayer is a movie player for LINUX (runs on many other Unices, and
non-x86 CPUs, see the documentation). It plays most MPEG, VOB, AVI,
VIVO, ASF/WMV, QT/MOV, FLI, NuppelVideo, yuv4mpeg, FILM, RoQ, and some
RealMedia files, supported by many native, XAnim, and Win32 DLL codecs.
You can watch VideoCD, SVCD, DVD, 3ivx, FLI, and even DivX movies too
(and you don't need the avifile library at all!). The another big
feature of mplayer is the wide range of supported output drivers. It
works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, but you can use
SDL (and this way all drivers of SDL), VESA (on every VESA compatible
card, even without X!), and some lowlevel card-specific drivers (for
Matrox, 3Dfx and Radeon) too! Most of them supports software or hardware
scaling, so you can enjoy movies in fullscreen. MPlayer supports
displaying through some hardware MPEG decoder boards, such as the DVB
and DXR3/Hollywood+! And what about the nice big antialiased shaded
subtitles (9 supported types!!!) with european/ISO 8859-1,2 (hungarian,
english, czech, etc), cyrillic, korean fonts, and OSD?

Note: If you want to play Real content, you need to have the content
of RealPlayer's Codecs directory in %_libdir/codecs/
%if %build_plf

This package is in PLF because some included codecs are covered by
patents.  It also includes support for reading DVDs encrypted with CSS
which might be illegal in some countries.

For non-free binary codecs support you should install the packages
win32-codecs, real-codecs and xanim-codecs.
%endif

%package doc
Summary: %{Name} documentation
Group: Books/Computer books

%description doc
This package contains documentation for %{Name}.

%if %build_gui
%package gui
Summary:	GUI for %{name}
Group:		Video
Requires:	%{name} = %{version}
BuildRequires:	gtk+2-devel
BuildRequires:	imagemagick
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
Requires: soundwrapper
Conflicts:	mplayer-skins < 1.3-8mdk
Conflicts:	mplayer-gui

%description gui
This package contains a GUI for %{name}.
%endif

%if %build_mencoder
%package -n mencoder%{pkgsuffix}%{pkgext}
Summary: MPlayer's movie encoder
Group:		Video
Requires:	%{name} = %version
Conflicts:	mencoder

%description -n mencoder%{pkgsuffix}%{pkgext}
MEncoder a movie encoder and is a part of the MPlayer package.
%if !%build_plf
Note: this version doesn't have support for encoding mp3 audio streams in the
video files. 
%else
This PLF build has additional support for AAC decoding with libfaad
and MP3 encoding with lame, both are covered by software patents. It
also includes support for reading DVDs encrypted with CSS which might
be illegal in some countries.
%endif
%endif


%prep
rm -rf $RPM_BUILD_ROOT

%if %svn
%setup -q -n %name-%{svn} -a 4
%else
%setup -q -n MPlayer-%{version}%{prerel} -a 4
%endif
mv Blue %{name}
pushd %{name}
#gw fix permissions
find DOCS -type d|xargs chmod 755
find DOCS -type f|xargs chmod 644
find DOCS -name .svn|xargs rm -rf
chmod 644 AUTHORS Changelog README Copyright
rm -f Blue/README
%patch0 -p0 -b .mdv
#%patch3 -p1 -b .mp2
#%patch7 -p1 -b .mga
%patch12 -p1 -b .desktopentry
#%patch21 -p0 -b .compiz
%if %mdvver >= 200900
%patch26 -p1
%endif
%patch28 -p1 -b .rtsp-extra-fixes
%patch31 -p1 -b .format~
%patch33 -p0
%patch35 -p0
%patch36 -p0

perl -pi -e 's^r\$svn_revision^%release^' version.sh

mv DOCS/README README.DOCS

# from mplayer-vaapi's checkout-patch-build.sh
patch -p1 < ../patches/mplayer-vaapi.patch                      || exit 1
patch -p1 < ../patches/mplayer-vaapi-gma500-workaround.patch    || exit 1
patch -p1 < ../patches/mplayer-vaapi-0.29.patch                 || exit 1
patch -p1 < ../patches/mplayer-vdpau.patch                      || exit 1

# (blino) vaapi fixes
%patch100 -p2 -b .linkva

popd

%build
pushd %{name}
%if !%build_optimization
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
%endif
%if %build_debug
export CFLAGS="$CFLAGS -g"
%endif
%ifarch ppc
export CFLAGS="$CFLAGS -mcpu=7450 -maltivec"
%endif
%if %build_directfb
export CPPFLAGS="-I%_includedir/directfb"
%endif
%if %{build_3264bit}
export EXESUF=32
%endif
export LDFLAGS="%{?ldflags}"
./configure \
	--prefix=%{_prefix} \
	--datadir=%{_datadir}/%{name} \
	--confdir=%{_sysconfdir}/%{name} \
	--libdir=%_libdir \
	--enable-largefiles \
%if !%build_optimization
%ifnarch x86_64
	--enable-runtime-cpudetection \
%endif
%ifarch %ix86
        --enable-mmx \
        --enable-3dnow \
        --enable-sse \
        --enable-sse2 \
        --enable-fastmemcpy \
%endif
%endif
	--enable-freetype \
	--enable-nas \
%if %build_debug
	--enable-debug=3 \
%else
	--disable-sighandler \
%endif
%if %build_gui
	--enable-gui \
%endif
	--language=all \
	\
%if ! %build_faad
	--disable-faad-internal \
%endif
	--disable-libdvdcss-internal \
%if %build_lirc
	--enable-lirc \
%else
	--disable-lirc \
%endif
	--enable-tv \
%if ! %build_v4l2
	--disable-tv-v4l2 \
%endif
	--enable-joystick \
	\
	--enable-gl \
        --disable-svga \
%if ! %build_mga
	--disable-mga \
%endif
%if ! %build_fbdev
	--disable-fbdev \
%endif
%if %build_directfb
       --enable-directfb \
%else
       --disable-directfb \
%endif
%if %build_mencoder
	--enable-mencoder \
%else
	--disable-mencoder \
%endif
%if ! %build_live
	--disable-live \
%endif
%if ! %build_vesa
       --disable-vesa \
%endif
%if %build_theora
	--enable-theora \
%else
	--disable-theora \
%endif
	--enable-menu \
%if %build_xmms
	--enable-xmms --with-xmmslibdir=%{_libdir} \
%endif
%if %build_smb
	--enable-smb \
%endif
%if %build_dvb
%if %mdkversion < 1000
	--with-dvbincdir=/usr/src/linux/3rdparty/mod_dvb/include \
%endif
%else
       --disable-dvb \
       --disable-dvbhead \
%endif
%if ! %build_ggi
	--disable-ggi \
%endif
	--codecsdir=%{_libdir}/codecs \
%if ! %build_arts
	--disable-arts \
%endif
%if ! %build_jack
	--disable-jack \
%endif
%if ! %build_aa
	--disable-aa \
%endif
%if ! %build_cdda
	--disable-cdparanoia \
%endif
%if ! %build_dv
	--disable-libdv \
%endif
%if ! %build_lzo
	--disable-liblzo \
%endif
%if ! %build_sdl
	--disable-sdl \
%endif
%if ! %build_alsa
	--disable-alsa \
%endif
%if ! %build_fribidi
	--disable-fribidi \
%endif
%if !%build_enca
	--disable-enca \
%endif
%if %build_pulse
	--enable-pulse \
%endif
%if !%build_openal
	--disable-openal \
%endif
	--enable-zr \
%if %build_xvmc
	--enable-xvmc \
%endif
%if ! %build_ivtv
	--disable-ivtv \
%endif
%if %build_vaapi
	--enable-vaapi \
%endif
%if ! %build_vdpau
	--disable-vdpau
%endif


# Keep this line before empty end %%configure (ppc conditionnal pb)
%if %mdkversion == 1000 && %build_optimization
make CC=gcc" -fno-unit-at-a-time" EXESUF=%{pkgext}
%else
make EXESUF=%{pkgext}
%endif
#gw make sure we have our version string included:
fgrep %release version.h

# build HTML docs
(cd DOCS/xml && make)
popd

%install
rm -rf $RPM_BUILD_ROOT
pushd %{name}
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%name
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%name
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/{de,fr,hu,pl,es,it,zh_CN,""}/man1
install -m 755 mplayer%{pkgext} $RPM_BUILD_ROOT%{_bindir}
install -m 644 DOCS/man/en/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/de/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/de/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/fr/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/fr/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/hu/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/hu/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/pl/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/pl/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/zh_CN/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/zh_CN/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/es/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/es/man1/mplayer%{pkgext}.1
install -m 644 DOCS/man/it/mplayer.1 $RPM_BUILD_ROOT%{_mandir}/it/man1/mplayer%{pkgext}.1
 
%if %build_mencoder
install -m 755 mencoder%{pkgext} $RPM_BUILD_ROOT%{_bindir}
for man_dir in $RPM_BUILD_ROOT%{_mandir}/{de,fr,hu,pl,es,it,zh_CN,""}/man1; do
(cd $man_dir && ln -s mplayer%{pkgext}.1 mencoder%{pkgext}.1)
done
install -m 755 TOOLS/mencvcd.sh %buildroot%_bindir/mencvcd%{pkgext}
install -m 755 TOOLS/divx2svcd.sh %buildroot%_bindir/divx2svcd%{pkgext}
install -m 755 TOOLS/wma2ogg.pl %buildroot%_bindir/wma2ogg%{pkgext}.pl
install -m 755 TOOLS/midentify.sh %buildroot%_bindir/midentify%{pkgext}
%endif
install -m 644 etc/example.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mplayer.conf
install -m 644 etc/menu.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}

%if %build_gui
# default Skin
install -d -m 755 %buildroot%_datadir/%name/Skin/
cp -r Blue %buildroot%_datadir/%name/Skin/
ln -s Blue %buildroot%_datadir/%name/Skin/default
# gmplayer equals mplayer -gui
(cd $RPM_BUILD_ROOT%{_bindir} && ln -s mplayer%{pkgext} gmplayer%{pkgext})
# icons
mkdir -p $RPM_BUILD_ROOT{%_liconsdir,%_iconsdir,%{_miconsdir}}
convert -transparent white Blue/icons/icon48x48.png $RPM_BUILD_ROOT%{_liconsdir}/mplayer%{pkgext}.png 
convert -transparent white Blue/icons/icon32x32.png $RPM_BUILD_ROOT%{_iconsdir}/mplayer%{pkgext}.png 
convert -transparent white -scale 16x16 Blue/icons/icon48x48.png $RPM_BUILD_ROOT%{_miconsdir}/mplayer%{pkgext}.png
install -D -m 644 etc/mplayer.desktop %buildroot%_datadir/applications/mplayer%{pkgext}.desktop
perl -pi -e 's@mplayer$@mplayer%{pkgext}@g' %buildroot%_datadir/applications/mplayer%{pkgext}.desktop
%endif
%if %{build_3264bit}
if [ -e %{buildroot}%{_liconsdir}/mplayer%{pkgext}.png ]; then
	convert %{buildroot}%{_liconsdir}/mplayer%{pkgext}.png -channel green -negate \
		%{buildroot}%{_liconsdir}/mplayer%{pkgext}.png
fi
if [ -e %{buildroot}%{_iconsdir}/mplayer%{pkgext}.png ]; then
	convert %{buildroot}%{_iconsdir}/mplayer%{pkgext}.png -channel green -negate \
		%{buildroot}%{_iconsdir}/mplayer%{pkgext}.png
fi
if [ -e %{buildroot}%{_miconsdir}/mplayer%{pkgext}.png ]; then
	convert %{buildroot}%{_miconsdir}/mplayer%{pkgext}.png -channel green -negate \
        	%{buildroot}%{_miconsdir}/mplayer%{pkgext}.png
fi
%endif

popd

for f in AUTHORS Changelog README Copyright README.DOCS DOCS; do
    ln -snf %{name}/$f .
done

%if %build_debug
export DONT_STRIP=1
%endif
%if %mdkversion < 200900
%post -p /sbin/ldconfig
%endif
%if %mdkversion < 200900
%postun -p /sbin/ldconfig
%endif

%if %build_gui
%pre gui
if [ -d %_datadir/%name/Skin/default ]
  then rm -rf %_datadir/%name/Skin/default
fi
%if %mdkversion < 200900
%post gui
%{update_menus}
%update_desktop_database
%endif

%if %mdkversion < 200900
%postun gui
%{clean_menus}
%clean_desktop_database
%endif
%endif


%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS Changelog README Copyright
%dir %{_sysconfdir}/%name
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/mplayer.conf
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/menu.conf
%{_bindir}/midentify%{pkgext}
%{_bindir}/mplayer%{pkgext}
%{_mandir}/man1/mplayer%{pkgext}.1*
%lang(de) %{_mandir}/de/man1/mplayer%{pkgext}.1*
%lang(fr) %{_mandir}/fr/man1/mplayer%{pkgext}.1*
%lang(hu) %{_mandir}/hu/man1/mplayer%{pkgext}.1*
%lang(pl) %{_mandir}/pl/man1/mplayer%{pkgext}.1*
%lang(zh_CN) %{_mandir}/zh_CN/man1/mplayer%{pkgext}.1*
%lang(es) %{_mandir}/es/man1/mplayer%{pkgext}.1*
%lang(it) %{_mandir}/it/man1/mplayer%{pkgext}.1*
%dir %{_datadir}/%{name}

%files doc
%defattr(-,root,root)
%doc README.DOCS
%doc DOCS/default.css DOCS/HTML DOCS/tech/
%if %build_mencoder
%files -n mencoder%{pkgsuffix}%{pkgext}
%defattr(-,root,root)
%{_bindir}/mencoder%{pkgext}
%{_bindir}/divx2svcd%{pkgext}
%{_bindir}/mencvcd%{pkgext}
%{_bindir}/wma2ogg%{pkgext}.pl
%{_mandir}/man1/mencoder%{pkgext}.1*
%lang(de) %{_mandir}/de/man1/mencoder%{pkgext}.1*
%lang(fr) %{_mandir}/fr/man1/mencoder%{pkgext}.1*
%lang(hu) %{_mandir}/hu/man1/mencoder%{pkgext}.1*
%lang(pl) %{_mandir}/pl/man1/mencoder%{pkgext}.1*
%lang(zh_CN) %{_mandir}/zh_CN/man1/mencoder%{pkgext}.1*
%lang(es) %{_mandir}/es/man1/mencoder%{pkgext}.1*
%lang(it) %{_mandir}/it/man1/mencoder%{pkgext}.1*
%endif

%if %build_gui
%files gui
%defattr(-,root,root)
%{_bindir}/gmplayer%{pkgext}
%_datadir/applications/mplayer%{pkgext}.desktop
%_datadir/%name/Skin/
%{_iconsdir}/mplayer%{pkgext}.png
%{_miconsdir}/mplayer%{pkgext}.png
%{_liconsdir}/mplayer%{pkgext}.png
%endif




%changelog
* Sun Apr 25 2010 Anssi Hannula <anssi@mandriva.org> 1.0-1.rc4.0.20100414.1mdv2010.1
+ Revision: 538653
- new snapshot
- adapt to the move of all binary codecs to %%_libdir/codecs

* Fri Feb 26 2010 Olivier Blin <oblin@mandriva.com> 1.0-1.rc4.0.20100224.3mdv2010.1
+ Revision: 511682
- fix underlinking with libva
- buildrequire libva-devel

* Fri Feb 26 2010 Olivier Blin <oblin@mandriva.com> 1.0-1.rc4.0.20100224.2mdv2010.1
+ Revision: 511478
- add -vaapi suffix to mencoder package
- build mencoder:
  o zr support fails to build with encoder enabled (upstream bug)
  o mencoder can use vaapi

  + Anssi Hannula <anssi@mandriva.org>
    - add conflicts with main mplayer

* Thu Feb 25 2010 Olivier Blin <oblin@mandriva.com> 1.0-1.rc4.0.20100224.1mdv2010.1
+ Revision: 511246
- adapt to mplayer-vaapi tarball
- apply vaapi patches
- enable vaapi (also disable vdpau like upstream)
- fork mplayer-vaapi from mplayer package
  (vaapi patches may be difficult to rediff for main mplayer snapshots)

* Sat Jan 23 2010 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r30392.1mdv2010.1
+ Revision: 495207
- new snapshot

* Sun Jan 10 2010 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r30268.1mdv2010.1
+ Revision: 489248
- new snapshot
- fix giflib detection
- build with a52dec and openjpeg support
- fix fribidi build

  + Oden Eriksson <oeriksson@mandriva.com>
    - rebuilt against libjpeg v8

* Sun Dec 27 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r30130.1mdv2010.1
+ Revision: 482824
- new version
- drop patch 34

* Thu Dec 10 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r29987.1mdv2010.1
+ Revision: 476009
- new version
- rediff patch 0

* Tue Nov 24 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r29964.1mdv2010.1
+ Revision: 469542
- new snapshot
- add patch for DVD crash (bug #55443)

* Sun Nov 08 2009 Funda Wang <fwang@mandriva.org> 1.0-1.rc4.0.r29850.3mdv2010.1
+ Revision: 463088
- rebuild for new dfb

* Sat Nov 07 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc4.0.r29850.2mdv2010.1
+ Revision: 462398
- new snapshot

* Fri Oct 16 2009 Colin Guthrie <cguthrie@mandriva.org> 1.0-1.rc3.0.r29554.2mdv2010.0
+ Revision: 457955
- Fix initial volume setting with pulseaudio

  + Götz Waschk <waschk@mandriva.org>
    - increase version number

* Thu Aug 27 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.25.r29554.1mdv2010.0
+ Revision: 421677
- new snapshot

* Sat Aug 15 2009 Oden Eriksson <oeriksson@mandriva.com> 1.0-1.rc2.25.r29434.2mdv2010.0
+ Revision: 416529
- rebuilt against libjpeg v7

* Tue Jul 21 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.25.r29434.1mdv2010.0
+ Revision: 398417
- new snapshot
- build with bs2b support

* Mon Jul 20 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.25.r29433.1mdv2010.0
+ Revision: 398107
- use default linker flags (Anssi)
- new snapshot
- build with opencore-amr

* Fri Jul 10 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r29416.1mdv2010.0
+ Revision: 394085
- new snapshot
- fix version string patching

* Wed Jul 01 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r29409.1mdv2010.0
+ Revision: 391373
- new snapshot
- update patches 12,28,33
- spec fix

* Mon Mar 02 2009 Anssi Hannula <anssi@mandriva.org> 1.0-1.rc2.23.r28791.2mdv2009.1
+ Revision: 347009
- fix --with(out) xvmc build option
- enable vdpau support, enabled on 2009.0 and newer

* Mon Mar 02 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r28791.1mdv2009.1
+ Revision: 346961
- new snapshot
- rediff patch 31
- update build deps
- enable bzip2 support

* Thu Jan 29 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r28387.1mdv2009.1
+ Revision: 335187
- new snapshot
- fix customization of the version string
- disable dirac and schroedinger on 2009.0

* Fri Jan 23 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r28348.1mdv2009.1
+ Revision: 332710
- new snapshot
- drop patch 1
- fix icon

* Thu Jan 22 2009 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23.r28347.1mdv2009.1
+ Revision: 332605
- new snapshot
- enable dirac, schroedinger, mng support
- always use included libdvdnav and libdvdread
- drop source 6
- drop patches 2,4,19,20,22,23,24,25,27,29,30
- rediff patch 12, 31
- disable patches 1,3,7,21
- fix build

  + Per Øyvind Karlsen <peroyvind@mandriva.org>
    - fix issue with attempting to free an invalid pointer when opening rar files (P32)
    - fix build with -Werror=format-security (P31)

  + Oden Eriksson <oeriksson@mandriva.com>
    - lowercase ImageMagick

* Wed Oct 29 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.23mdv2009.1
+ Revision: 298652
- fix for CVS-2008-0073

* Sun Oct 19 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.22mdv2009.1
+ Revision: 295423
- rebuild

* Mon Oct 13 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.21mdv2009.1
+ Revision: 293180
- rebuild

* Mon Oct 13 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.20mdv2009.1
+ Revision: 293089
- fix build with new libx264

* Sun Oct 12 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.19mdv2009.1
+ Revision: 292980
- rebuild

* Mon Sep 29 2008 Frederik Himpe <fhimpe@mandriva.org> 1.0-1.rc2.18mdv2009.0
+ Revision: 289726
- Add security patch fixing integer buffer underflow
  (http://www.ocert.org/advisories/ocert-2008-013.html)

* Tue Sep 16 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.17mdv2009.0
+ Revision: 285191
- P27: security fix for CVE-2008-1558
- P28: fixes for crashes found together with CVE-2008-1558
- disable ivtv, it does not build

* Fri Sep 05 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.16mdv2009.0
+ Revision: 281075
- patch to add scaletempo filter (bug #43529)
- build with new fribidi

* Sun Aug 17 2008 Funda Wang <fwang@mandriva.org> 1.0-1.rc2.15mdv2009.0
+ Revision: 273058
- disable smb in mdv > 2009 due to license incompatible
- rebuild for new dfb

  + Götz Waschk <waschk@mandriva.org>
    - disable dirac by default

* Fri Jul 18 2008 Buchan Milne <bgmilne@mandriva.org> 1.0-1.rc2.14mdv2009.0
+ Revision: 238214
- Buildrequire libsmbclient-devel < 3.2.0 to avoid GPLv2 vs GPLv3 issues

  + Pixel <pixel@mandriva.com>
    - rpm filetriggers deprecates update_menus/update_scrollkeeper/update_mime_database/update_icon_cache/update_desktop_database/post_install_gconf_schemas
    - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers

* Fri May 30 2008 Funda Wang <fwang@mandriva.org> 1.0-1.rc2.13mdv2009.0
+ Revision: 213500
- rebuild for new directfb

* Fri May 16 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.12mdv2009.0
+ Revision: 208085
- support building with external faad again
- spec cleanup

* Thu Apr 24 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.11mdv2009.0
+ Revision: 197147
- fix build with new libdvdnav

* Wed Feb 13 2008 Frederic Crozat <fcrozat@mandriva.com> 1.0-1.rc2.10mdv2008.1
+ Revision: 167031
- Update patch20 with SVN version of pulseaudio plugin, fixes Mdv bug #36461
- Update patch0 to check pulse output first, if present

* Tue Feb 05 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.9mdv2008.1
+ Revision: 162707
- add four official security patches
- fix bug #37263 (default video output)

* Sun Jan 27 2008 Giuseppe Ghibò <ghibo@mandriva.com> 1.0-1.rc2.8mdv2008.1
+ Revision: 158705
- Add support for mplayer32 (to allow coexisting with 64bit mplayer in X86_64 arch, to be rebuild with --with 3264bit flag).

* Sat Jan 26 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.7mdv2008.1
+ Revision: 158373
- update dirac patch and enable it
- add support for building with dirac

* Thu Jan 17 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.6mdv2008.1
+ Revision: 154482
- rebuild

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Wed Jan 02 2008 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.5mdv2008.1
+ Revision: 140382
- stop screensaver by default (bug #35863)

  + Thierry Vignaud <tv@mandriva.org>
    - kill re-definition of %%buildroot on Pixel's request

* Mon Nov 26 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.4mdv2008.1
+ Revision: 112144
- remove input.conf to fix bug #35516
- remove URL parameter from the desktop file (bug #35248)

* Sat Oct 13 2007 Colin Guthrie <cguthrie@mandriva.org> 1.0-1.rc2.3mdv2008.1
+ Revision: 97955
- Reenable Compiz and PulseAudio support by applying updated patches

* Wed Oct 10 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.2mdv2008.1
+ Revision: 96835
- remove codecs.conf

* Wed Oct 10 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc2.1mdv2008.1
+ Revision: 96634
- drop patch 11
- new version
- disable compiz and pulse support
- drop amr sources, now external libamrnb/wb is supported
- drop vidix
- drop patches 2,4,5,6,8,9,10,12,13,14,15,16,17,18,20,21,22
- rediff patches 3,12
- bump dvdnav dep
- drop legacy menu

  + Guillaume Rousse <guillomovitch@mandriva.org>
    - rebuild

* Fri Sep 14 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.20mdv2008.0
+ Revision: 85498
- security fix for avi index reader

* Sun Jul 15 2007 Colin Guthrie <cguthrie@mandriva.org> 1.0-1.rc1.19mdv2008.0
+ Revision: 52228
- Rebuild due to build system hiccup

* Sat Jul 14 2007 Colin Guthrie <cguthrie@mandriva.org> 1.0-1.rc1.18mdv2008.0
+ Revision: 52121
- Add compiz support to xv output (needs compiz 'video' plugin to be active)

* Wed Jun 27 2007 Andreas Hasenack <andreas@mandriva.com> 1.0-1.rc1.17mdv2008.0
+ Revision: 44944
- rebuild with new rpm-mandriva-setup (-fstack-protector)

* Thu Jun 07 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.16mdv2008.0
+ Revision: 36497
- security fix for CDDB overflow

* Mon Jun 04 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.15mdv2008.0
+ Revision: 35218
- curity fix for CVE-2006-6172 (realmedia buffer overflow)
- amrwb update

* Mon May 21 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.14mdv2008.0
+ Revision: 29464
- rebuild

* Sat May 12 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.13mdv2008.0
+ Revision: 26466
- disable dirac again, it was breaking MPEG detection

* Fri May 11 2007 Götz Waschk <waschk@mandriva.org> 1.0-1.rc1.12mdv2008.0
+ Revision: 26249
- patch for dirac support