#!/bin/sh # # orbit@lazerlink.com # # Wrote by keeing notes and updating as I installed. I tested it, # and it worked for me. Before you run it, modify this script to # adjust the "Archives & Extensions" and the "Directories" sections # below: # ### # Archives & Extensions ### # Declare the archive and extension independantly MPLAYER_ARC=MPlayer-current ; MPLAYER_EXT=.tar.bz2 SVGA_ARC=svgalib-1.9.12-10.i386 ; SVGA_EXT=.rpm _3IVX_ARC=3ivxopenqt1i686linuxglibc21 ; _3IVX_EXT=.tgz SDL_ARC=SDL-1.2.3 ; SDL_EXT=.tar.gz W32_ARC=w32codec-0.60 ; W32_EXT=.tar.bz2 SKIN_ARC=neutron ; SKIN_EXT=.tar.bz2 CVID_ARC=vid_cvid_2.1_linuxELFx86c6 ; CVID_EXT=.tgz CYUV_ARC=vid_cyuv_1.0_linuxELFx86c6 ; CYUV_EXT=.tgz H261_ARC=vid_h261_1.0_linuxELFx86c6 ; H261_EXT=.tgz H263_ARC=vid_h263_1.1_linuxELFx86c6 ; H263_EXT=.tgz IV32_ARC=vid_iv32_2.1_linuxELFx86c6 ; IV32_EXT=.tgz IV41_ARC=vid_iv41_1.1_linuxELFx86c6 ; IV41_EXT=.tgz IV50_ARC=vid_iv50_1.0_linuxELFx86c6 ; IV50_EXT=.tgz ### # Directories ### # Declare the download directory DLOAD_DIR=`pwd` # Declare the installation directory UPACK_DIR=`pwd`/MPlayer-current # Declare the directory to unpack XANIM codecs XANIM_MOD_DIR=/usr/local/lib/xanim/mods # Declare the Win32 codecs directory W32_CODECS_DIR=/usr/local/lib/win32 # Declare the directory to unpack skins SKIN_DIR=/usr/local/share/mplayer/Skin ### # Functions ### # Declare a function to extact archives based on extension extractArc () { ARC=$1; EXT=$2 if [ "$EXT" = ".tgz" ] then tar xvzf ${DLOAD_DIR}/${ARC}${EXT} elif [ "$EXT" = ".tar.gz" ] then tar xvzf ${DLOAD_DIR}/${ARC}${EXT} elif [ "$EXT" = ".tar.bz2" ] then tar xvjf ${DLOAD_DIR}/${ARC}${EXT} elif [ "$EXT" = ".rpm" ] then rpm -Uvh ${DLOAD_DIR}/${ARC}${EXT} fi } # Unpack the MPlayer software unpackMplayer () { extractArc $MPLAYER_ARC $MPLAYER_EXT mv MPlayer-2* $UPACK_DIR cd $UPACK_DIR } # Install the SVGA lib unpackSVGALib () { cd $UPACK_DIR extractArc $SVGA_ARC $SVGA_EXT } # Unpack the SDL Library unpackSDL () { cd $UPACK_DIR extractArc $SDL_ARC $SDL_EXT cd $SDL_ARC ./configure make make install echo "SDL Library Done - \"Enter\" to continue." read ans } # Unpack the W32 codecs unpackW32 () { cd $UPACK_DIR extractArc $W32_ARC $W32_EXT rm -rf $W32_CODECS_DIR mkdir -p $W32_CODECS_DIR cp -r $W32_ARC/* $W32_CODECS_DIR/ echo "W32 Codec Done - \"Enter\" to continue." read ans } # Unpack some extra codex for XANIM unpackCodex () { cd $UPACK_DIR extractArc ${CVID_ARC} ${CVID_EXT} extractArc ${CYUV_ARC} ${CYUV_EXT} extractArc ${H261_ARC} ${H261_EXT} extractArc ${H263_ARC} ${H263_EXT} extractArc ${IV32_ARC} ${IV32_EXT} extractArc ${IV41_ARC} ${IV41_EXT} extractArc ${IV50_ARC} ${IV50_EXT} mkdir -p $XANIM_MOD_DIR mv vid*.xa $XANIM_MOD_DIR cd $XANIM_MOD_DIR ln -sf ${CVID_ARC}.xa vid_cvid.so ln -sf ${CYUV_ARC}.xa vid_cyuv.so ln -sf ${H261_ARC}.xa vid_h261.so ln -sf ${H263_ARC}.xa vid_h263.so ln -sf ${IV32_ARC}.xa vid_iv32.so ln -sf ${IV41_ARC}.xa vid_iv41.so ln -sf ${IV50_ARC}.xa vid_iv50.so echo "XANIM Codecs Done - \"Enter\" to continue." read ans } # Unpack the 3IVX Codec unpack3IVX () { cd $UPACK_DIR extractArc $_3IVX_ARC $_3IVX_EXT cd 3ivx-openquicktime-* cp *.so $XANIM_MOD_DIR mv *.so /usr/local/lib mv oqt* /usr/local/bin mv qt* /usr/local/bin mv dechunk /usr/local/bin mv make_streamable /usr/local/bin cp recover /usr/local/bin cd $XANIM_MOD_DIR ln -sf /usr/local/lib/quicktime_codec_3IV1.so vid_3ivx.so echo "3IVX Codecs Done - \"Enter\" to continue." read ans } # Unpack the skin unpackSkin () { cd $UPACK_DIR extractArc ${SKIN_ARC} ${SKIN_EXT} mkdir -p $SKIN_DIR if [ ! -z "$SKIN_ARC" ] then rm -rf $SKIN_DIR/${SKIN_ARC} fi mv ${SKIN_ARC} $SKIN_DIR/ echo "MPlayer Skin Done - \"Enter\" to continue." read ans } # Configure MPlayer configure() { cd $UPACK_DIR ./configure \ --with-win32libdir=${W32_CODECS_DIR} \ --with-sdl-config=/usr/local/bin/sdl-config \ --with-xanimlibdir=${XANIM_MOD_DIR} \ --enable-svga \ --enable-sdl \ --enable-gui echo "MPlayer Configure Done - \"Enter\" to continue." read ans } # Install MPlayer install() { cd $UPACK_DIR gmake gmake install echo "MPlayer Install Done - \"Enter\" to continue." read ans } # Creates Startup Script createStartupScript() { MVP=/usr/local/bin/mvp rm -f $MVP touch $MVP echo '#!/bin/sh' > $MVP echo '' >> $MVP echo "SKIN=$SKIN_ARC" >> $MVP echo 'xterm -e mplayer -xy 2 -loop 0 -gui -skin $SKIN $1' >> $MVP chmod +x $MVP echo "Startup Script Done" echo "\tTry \"$MVP {Mpg-Mov-Avi-File}\" at the prompt!" echo "Done!" } ## # Main Program ## unpackMplayer unpackSVGALib unpackSDL unpackW32 unpackCodex unpack3IVX unpackSkin configure install createStartupScript