2010-05-11 14:56:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-05-12 17:41:43 +02:00
|
|
|
# Slackware build script for libsamplerate 0.1.6
|
|
|
|
# Written by paul wisehart paul@1ud2.com
|
2010-05-11 19:45:19 +02:00
|
|
|
# Modified by Robby Workman <rworkman@slackbuilds.org>
|
2010-05-11 14:56:21 +02:00
|
|
|
|
|
|
|
PRGNAM=libsamplerate
|
2010-05-12 17:41:43 +02:00
|
|
|
VERSION=0.1.6
|
2010-05-11 14:56:21 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
2010-05-11 22:24:07 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 14:56:21 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 19:45:19 +02:00
|
|
|
|
2010-05-11 14:56:21 +02: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-12 17:41:43 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:56:21 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-12 17:41:43 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:24:07 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-12 17:41:43 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-11 14:56:21 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-11 19:45:19 +02:00
|
|
|
set -e # Exit on most errors
|
|
|
|
|
2010-05-11 14:56:21 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-11 19:45:19 +02:00
|
|
|
cd $TMP
|
2010-05-11 14:56:21 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-11 19:45:19 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 14:56:21 +02:00
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
2010-05-11 19:45:19 +02:00
|
|
|
--prefix=/usr \
|
2010-05-12 17:41:43 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 19:45:19 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--disable-static \
|
2010-05-11 22:24:07 +02:00
|
|
|
--localstatedir=/var \
|
2010-05-12 17:41:43 +02:00
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 14:56:21 +02:00
|
|
|
|
2010-05-11 19:45:19 +02:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-11 14:56:21 +02:00
|
|
|
|
2010-05-11 22:24:07 +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 14:56:21 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a COPYING README doc/* $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.tgz
|