2010-05-12 02:01:22 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for mp3check
|
2010-05-13 06:21:37 +08:00
|
|
|
# Written by Audrius Kažukauskas <audrius@neutrino.lt>
|
2010-05-12 02:01:22 +08:00
|
|
|
|
|
|
|
PRGNAM=mp3check
|
2010-05-13 06:21:37 +08:00
|
|
|
VERSION=0.8.4
|
2010-05-12 02:01:22 +08:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 13:00:16 +08: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-12 02:01:22 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 06:21:37 +08:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 02:01:22 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 06:21:37 +08:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 13:00:16 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 02:01:22 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e # Exit on most errors
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-13 06:21:37 +08:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tgz
|
2010-05-12 02:01:22 +08:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
2010-05-13 06:21:37 +08:00
|
|
|
# Makefile doesn't support DESTDIR.
|
|
|
|
sed -i "s|/usr/local/bin|$PKG/usr/bin|" Makefile
|
|
|
|
mkdir -p $PKG/usr/bin
|
2010-05-12 02:01:22 +08:00
|
|
|
|
2010-05-13 06:21:37 +08:00
|
|
|
make OPT="$SLKCFLAGS"
|
|
|
|
make install
|
2010-05-12 02:01:22 +08:00
|
|
|
|
2010-05-13 06:21:37 +08:00
|
|
|
install -m 0644 -D mp3check.1 $PKG/usr/man/man1/mp3check.1
|
|
|
|
gzip -9 $PKG/usr/man/man1/*
|
2010-05-12 02:01:22 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 06:21:37 +08:00
|
|
|
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-12 02:01:22 +08:00
|
|
|
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 06:21:37 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|