slackbuilds_ponce/audio/mpc/mpc.SlackBuild

91 lines
2 KiB
Text
Raw Normal View History

2010-05-11 15:00:27 +02:00
#!/bin/sh
# Slackware build script for mpc
# Written by Meckafett thumpadoodle@hotmail.com
PRGNAM=mpc
VERSION=0.12.1
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
2010-05-13 00:21:43 +02:00
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
2010-05-11 15:00:27 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
2010-05-13 00:21:43 +02:00
DOCS="AUTHORS COPYING ChangeLog INSTALL README
doc/mpc-bashrc doc/mppledit doc/pls-handler.sh
doc/m3u-handler.sh"
2010-05-11 15:00:27 +02:00
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
2010-05-13 00:21:43 +02:00
LIBDIRSUFFIX=""
2010-05-11 15:00:27 +02:00
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
2010-05-13 00:21:43 +02:00
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
2010-05-11 15:00:27 +02:00
fi
2010-05-13 00:21:43 +02:00
set -e
2010-05-11 15:00:27 +02:00
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
2010-05-13 00:21:43 +02:00
--libdir=/usr/lib${LIBDIRSUFFIX} \
2010-05-11 15:00:27 +02:00
--sysconfdir=/etc \
--datarootdir=/usr \
--localstatedir=/var
make
make install DESTDIR=$PKG
2010-05-19 08:31:20 +02:00
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
2010-05-11 15:00:27 +02:00
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
# Remove the documentation wrongly installed in /usr/share/doc
rm -rf $PKG/usr/share/
# Remove empty folder /usr/mpc
rm -rf $PKG/usr/mpc/
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
2010-05-13 00:21:43 +02:00
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}