# Copyright 2006, 2007, 2008, 2009 Eric Hameleers, Eindhoven, NL# Copyright 2009 Patrick J. Volkerding, Sebeka, MN, USA# All rights reserved.## 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.# -----------------------------------------------------------------------------## Slackware SlackBuild script # ===========================# By: Eric Hameleers <alien@slackware.com># For: MPlayer# Descr: a movie player for LINUX# URL: http://www.mplayerhq.hu/# -----------------------------------------------------------------------------

CODECSDIR=/usr/lib${LIBDIRSUFFIX}/codecs # Where the WIN32 codecs are expected for instance

# ---------------------------------------------------------------------------# -- PATENT ALERT! --# MPlayer source contains an internal copy of 'libdvdcss' for reading DVD's.# This is considered illegal software in some countries.# Also, MPLayer can be built with MP3 (lame) and AMR audio encoders# (needed for FLV and .3GP videos) but these libraries are 'contaminated'# with patents from Fraunhofer and GGP.# Also, the AAC encoder has patent issues.# The Slackware package is built with "USE_PATENTS=NO" i.e. without using# the lame mp3, faac, AMR and dvdcss libraries.# This also means that this creates a version of MPlayer that is unable# to play encrypted DVD's (which is most DVD's on the market). If it is# allowed in your country to use libdvdcss, this is not a big problem though.# Install a libdvdcss package and it will be picked up automatically by# MPlayer's internal libdvdread library, so that MPlayer will again be able# to play encrypted DVD's.## If you have licenses to use the code, and/or the patents do not apply in# your region, and you take all legal responsibility, you may wish to build# MPlayer with the option USE_PATENTS=YES which will include potentially# patent-encumbered code.# ---------------------------------------------------------------------------USE_PATENTS=${USE_PATENTS:-"NO"}

# MPlayer will try to use one of the TrueType fonts present on the target# system for it's On Screen Display (OSD) font.# Slackware 11.0 ships with the Vera and DejaVu fonts, you may want to add# more fonts to this list. The first font found will be used by creating a# symbolic link "/usr/share/mplayer/subfont.ttf" to it.# The use of bitmapped fonts is considered deprecated, but you can still use# those if you want. Read http://www.mplayerhq.hu/DOCS/HTML/en/fonts-osd.html# if you want to know more about OSD font configuration.OSDFONTS="LiberationSans-Regular.ttf \ Arialuni.ttf arial.ttf \ DejaVuSans.ttf Vera.ttf"

# We will work with a stripped-down source tarball, not containing libdvdcss:[ "$USE_PATENTS" != "YES" ] && EXTRA="_nolibdvdcss" || EXTRA=""

# Where do we look for sources?SRCDIR=$(cd $(dirname $0); pwd)

SOURCE[0]="$SRCDIR/${PRGNAM}${EXTRA}-${VERSION}.tar.xz"SRCURL[0]=""

# The default skin to use (we need to add at least one)SOURCE[1]="$SRCDIR/${DEFSKIN}-${SKINVER}.tar.bz2"SRCURL[1]="http://www.mplayerhq.hu/MPlayer/skins/${DEFSKIN}-${SKINVER}.tar.bz2"

# Create working directories:mkdir -p $TMP/tmp-$PRGNAM # location to build the sourcerm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous buildmkdir -p $PKG # place for the package to be builtrm -rf $PKG/* # erase old package's contentsmkdir -p $OUTPUT # place for the package to be saved

# Warn about libdvdread requirement:if [ "$USE_PATENTS" != "YES" ]; then cat <<"EOT"**** Removing internal DeCSS library.** If you want to play encrypted DVD's you need to install libdvdcss separately.** You take full legal responsibility for any use of DeCSS. We neither supply** DeCSS code nor endorse any illegal use of it.**** If you are unaffected by patent concerns because you hold the required** licenses and permission to use the patented code, or reside in a** location where this is not a concern, and wish to include the patented** and restricted code (you take all legal responsibility for doing so),** then edit this SlackBuild script and change the line:** USE_PATENTS=${USE_PATENTS:-"NO"}** to:** USE_PATENTS="YES"**EOT sleep 5fi

# Installing a bitmap font is considered deprecated; use a TTF font instead.# We try to link to an installed TTF font at install time.# Configure a default TrueType font to use for the OSD :if [ ! -f usr/share/mplayer/subfont.ttf ]; then for font in ${OSDFONTS}; do if [ -f .${XPREF}/lib${LIBDIRSUFFIX}/X11/fonts/TTF/\${font} ]; then ( cd usr/share/mplayer/ ln -sf ${XPREF}/lib${LIBDIRSUFFIX}/X11/fonts/TTF/\${font} subfont.ttf ) break fi donefi

# Warn about libdvdcss requirement (again):if [ "$USE_PATENTS" != "YES" ]; then cat <<"EOT"**** Internal DECSS library was not built.** If you want to play encrypted DVD's you need to install libdvdcss separately.** You take full legal responsibility for any use of DeCSS. We neither supply** DeCSS code nor endorse any illegal use of it.**** If you are unaffected by patent concerns because you hold the required** licenses and permission to use the patented code, or reside in a** location where this is not a concern, and wish to include the patented** and restricted code (you take all legal responsibility for doing so),** then edit this SlackBuild script and change the line:** USE_PATENTS=${USE_PATENTS:-"NO"}** to:** USE_PATENTS="YES"**EOT