#!/bin/sh # Written by Thomas Bourdon # Copyright: See COPYING file at . # Build infos PRGNAM=mpd VERSION=${VERSION:-0.20.22} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} # Options # Input USE_AAC=${USE_AAC:-no} USE_AUDIOFILE=${USE_AUDIOFILE:-yes} USE_FFMPEG=${USE_FFMPEG:-no} USE_FLAC=${USE_FLAC:-yes} USE_MMS=${USE_MMS:-no} USE_MPC=${USE_MPC:-no} USE_SAMPLERATE=${USE_SAMPLERATE:-yes} USE_SNDFILE=${USE_SNDFILE:-yes} USE_VORBIS=${USE_VORBIS:-yes} USE_WAVPACK=${USE_WAVPACK:-yes} USE_ROAR=${USE_ROAR:-no} USE_CDIO=${USE_CDIO:-no} USE_SOUNDCLOUD=${USE_SOUNDCLOUD:-no} USE_SMB=${USE_SMB:-no} USE_NFS=${USE_NFS:-no} USE_GME=${USE_GME:-no} # Output USE_HTTPD=${USE_HTTPD:-yes} USE_JACK=${USE_JACK:-no} USE_PULSE=${USE_PULSE:-yes} USE_SHOUT=${USE_SHOUT:-no} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Determine some specific variables to build software. if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi # Exit on most errors set -e # Extract the software rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* cd $PRGNAM-$VERSION chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ -exec chmod 755 {} + -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} + # Build the software CFLAGS=$SLKCFLAGS \ CXXFLAGS=$SLKCFLAGS \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --enable-systemd-daemon=no \ --enable-audiofile=$USE_AUDIOFILE \ --enable-lsr=$USE_SAMPLERATE \ --enable-sndfile=$USE_SNDFILE \ --enable-wavpack=$USE_WAVPACK \ --enable-mms=$USE_MMS \ --enable-ffmpeg=$USE_FFMPEG \ --enable-flac=$USE_FLAC \ --enable-mpc=$USE_MPC \ --enable-vorbis=$USE_VORBIS \ --enable-aac=$USE_AAC \ --enable-jack=$USE_JACK \ --enable-pulse=$USE_PULSE\ --enable-shout=$USE_SHOUT \ --enable-httpd-output=$USE_HTTPD \ --enable-curl=$USE_HTTPD \ --enable-roar=$USE_ROAR \ --enable-cdio-paranoia=$USE_CDIO \ --enable-soundcloud=$USE_SOUNDCLOUD \ --enable-smbclient=$USE_SMB \ --enable-nfs=$USE_NFS \ --enable-gme=$USE_GME \ --enable-libwrap=no \ --build=$ARCH-slackware-linux make ${NUMJOBS:-" -j5 "} || make make install DESTDIR=$PKG # Strip binaries and libraries find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Install mpd.conf and rc.mpd mkdir -p $PKG/etc/rc.d cat $PKG/usr/doc/$PRGNAM-$VERSION/mpdconf.example > $PKG/etc/mpd.conf.new cat $CWD/rc.mpd.new > $PKG/etc/rc.d/rc.mpd.new # Compress man pages find $PKG/usr/man -type f -exec gzip -9 {} \; # Copy program documentation into the package mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ AUTHORS COPYING NEWS README.md \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # Copy the slack-desc and a custom doinst.sh into ./install mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh # Make the package cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}