2010-06-28 16:36:33 +02:00
|
|
|
#!/bin/sh
|
2013-11-03 21:25:44 +01:00
|
|
|
# Written by Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
|
2010-06-28 16:36:33 +02:00
|
|
|
|
|
|
|
PRGNAM=mp3val
|
|
|
|
VERSION=${VERSION:-0.1.8}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) export ARCH=i486 ;;
|
|
|
|
arm*) export ARCH=arm ;;
|
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
|
|
*) export ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -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
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz # source file comes with -src appended
|
|
|
|
mv $PRGNAM-$VERSION-src $PRGNAM-$VERSION # .tar extracts to directory with -src appended
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
mv Makefile.linux Makefile
|
|
|
|
|
|
|
|
chown -R root:root .
|
|
|
|
chmod 644 *
|
|
|
|
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
make
|
2010-06-28 22:30:01 +02:00
|
|
|
strip --strip-unneeded mp3val
|
2010-06-28 16:36:33 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
cp mp3val $PKG/usr/bin
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
changelog.txt manual.html \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
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
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|