##
## mplayer.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2004 The OpenPKG Project
## Copyright (c) 2000-2004 Ralf S. Engelschall
## Copyright (c) 2000-2004 Cable & Wireless
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package versions
%define V_mplayer 1.0pre5
%define V_blue 1.4
%define V_live 2004.12.09
# package information
Name: mplayer
Summary: Multimedia Player
URL: http://www.mplayerhq.hu/
Vendor: Árpád Gereöffy et al.
Packager: The OpenPKG Project
Distribution: OpenPKG
Class: EVAL
Group: Video
License: GPL and others
Version: %{V_mplayer}
Release: 20041210
# build options
%option with_gui no
%option with_win32 yes
# list of sources
Source0: ftp://ftp.mplayerhq.hu/MPlayer/releases/MPlayer-%{V_mplayer}.tar.bz2
Source1: ftp://ftp.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
Source2: ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/win32codecs.tar.bz2
Source3: ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/qt5dlls.tar.bz2
Source4: ftp://ftp.mplayerhq.hu/MPlayer/Skin/Blue-%{V_blue}.tar.bz2
Source5: http://www.live.com/liveMedia/public/live.%{V_live}.tar.gz
Patch0: mplayer.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc, make, sed
PreReq: OpenPKG, openpkg >= 20040130, X11
BuildPreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo, libsmbclient
PreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo, libsmbclient
%if "%{with_gui}" == "yes"
BuildPreReq: glib, gtk
PreReq: glib, gtk
%endif
AutoReq: no
AutoReqProv: no
%description
This is the Unix movie player. MPlayer can play most standard
video formats out of the box and almost all others with the help
of external codecs. MPlayer works best from the command line, but
visual feedback for many functions is available from its onscreen
status display (OSD), which is also used for displaying subtitles.
%track
prog mplayer = {
version = %{V_mplayer}
url = ftp://ftp.mplayerhq.hu/MPlayer/releases/
regex = MPlayer-(__VER__)\.tar\.bz2
}
prog mplayer:blue = {
version = %{V_blue}
url = ftp://ftp.mplayerhq.hu/MPlayer/Skin/
regex = Blue-(__VER__)\.tar\.bz2
}
prog mplayer:live = {
comment = "rse: new snapshots occur every second day, no need to upgrade such fast"
version = %{V_live}
url = http://www.live.com/liveMedia/public/
regex = live\.(__VER__)\.tar\.gz
}
%prep
%setup -q -n MPlayer-%{V_mplayer}
%setup -q -n MPlayer-%{V_mplayer} -T -D -a 5
%patch -p0
%{l_shtool} subst \
-e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
drivers/radeon/radeonfb.c \
loader/module.c \
loader/wrapper.h \
libmpdvdkit2/bsdi_ioctl.c \
libdha/sysdep/AsmMacros_alpha.h \
TVout/matroxset/matroxset.c \
TVout/matroxset/fb.h \
TVout/fbset/fbset.c \
TVout/fbset/fb.h \
TVout/con2fb/con2fb.c \
live/groupsock/*.cpp \
live/groupsock/include/*.h \
live/groupsock/include/*.hh \
live/liveMedia/*.cpp \
live/liveMedia/*.hh \
live/liveMedia/include/*.hh
%build
# translate target names into qmake system types
case "%{l_platform -t}" in
*-sunos* ) host=solaris ;;
*-linux* ) host=linux ;;
*-freebsd* ) host=freebsd ;;
* ) host=`uname | tr A-Z a-z` ;;
esac
# build live streaming libs first
( cd live
./genMakefiles $host
%{l_make} %{l_mflags}
) || exit $?
# configure programs
CC="%{l_cc}" \
CXX="%{l_cxx}" \
CFLAGS="%{l_cflags -O}" \
CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--confdir=%{l_prefix}/etc/mplayer/ \
--with-codecsdir=%{l_prefix}/libexec/mplayer/nativecodecs/ \
%if "%{with_gui}" == "yes"
--enable-gui \
--with-glib-config=%{l_prefix}/bin/glib-config \
--with-gtk-config=%{l_prefix}/bin/gtk-config \
%else
--disable-gui \
%endif
%if "%{with_win32}" == "yes"
--with-win32libdir=%{l_prefix}/libexec/mplayer/win32codecs \
--enable-win32 \
--enable-qtx \
%else
--disable-win32 \
%endif
--enable-largefiles \
--enable-live \
--with-livelibdir=`pwd`/live \
--enable-xvid \
--enable-freetype \
--enable-vorbis \
--enable-menu \
--enable-jpeg \
--enable-png \
--enable-sdl \
--enable-liblzo \
--enable-x11 \
--enable-smb \
--with-x11incdir=`%{l_rc} --query x11_incdir` \
--with-x11libdir=`%{l_rc} --query x11_libdir` \
--with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
--with-extralibdir=%{l_prefix}/lib/ \
--with-sdl-config=%{l_prefix}/bin/sdl-config \
--with-freetype-config=%{l_prefix}/bin/freetype-config \
--disable-i18n
# fix sloppy library defs for selected platforms
ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
case "%{l_platform -t}" in
*-sunos* )
if echo $ARCH_LIB | grep '\-pthread[^s]'; then
ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
fi
;;
esac
# temporary hack to fool faad dependencies
%{l_shtool} subst \
-e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
config.h
# build programs
%{l_make} %{l_mflags}
%install
rm -rf $RPM_BUILD_ROOT
# create installation tree
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
$RPM_BUILD_ROOT%{l_prefix}/man/man1 \
%if "%{with_gui}" == "yes"
$RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
%endif
$RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
$RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/nativecodecs
# install binaries
%{l_shtool} install -s -c -m 755 \
mplayer \
mencoder \
$RPM_BUILD_ROOT%{l_prefix}/bin/
%if "%{with_gui}" == "yes"
%{l_shtool} mkln -s -f \
$RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
$RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
%endif
# install manpages
%{l_shtool} install -c -m 644 \
DOCS/man/en/mplayer.1 \
$RPM_BUILD_ROOT%{l_prefix}/man/man1/
%{l_shtool} mkln -s -f \
$RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
$RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
# install configuration files
%{l_shtool} install -c -m 644 \
-e 's;^\([a-z]\);# \1;' \
etc/example.conf \
$RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
%{l_shtool} install -c -m 644 \
etc/codecs.conf etc/input.conf etc/menu.conf \
$RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
%if "%{with_gui}" == "yes"
# install a default skin
( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
%{l_bzip2} -dc %{SOURCE Blue-%{V_blue}.tar.bz2} | %{l_tar} -xvf -
%{l_shtool} mkln -s -f Blue default
) || exit $?
%endif
# install fonts for OSD and subtitles
%{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
$RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
%if "%{with_win32}" == "yes"
# install win32 and quicktime codecs
( %{l_shtool} mkdir -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
%{l_bzip2} -dc %{SOURCE win32codecs.tar.bz2} | %{l_tar} -xvf -
) || exit $?
%{l_bzip2} -dc %{SOURCE qt5dlls.tar.bz2} | %{l_tar} -xvf -
mv -f qt5dlls/* $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/win32codecs/
%endif
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
'%config %{l_prefix}/etc/mplayer/*'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT