summaryrefslogtreecommitdiff
path: root/source/l/libsamplerate/libsamplerate.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/libsamplerate/libsamplerate.SlackBuild')
-rwxr-xr-xsource/l/libsamplerate/libsamplerate.SlackBuild35
1 files changed, 25 insertions, 10 deletions
diff --git a/source/l/libsamplerate/libsamplerate.SlackBuild b/source/l/libsamplerate/libsamplerate.SlackBuild
index 2c05e694..25d9419b 100755
--- a/source/l/libsamplerate/libsamplerate.SlackBuild
+++ b/source/l/libsamplerate/libsamplerate.SlackBuild
@@ -1,30 +1,31 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for libsamplerate
# Written by paul wisehart paul@1ud2.com
# Modified by Robby Workman <rworkman@slackbuilds.org>
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=libsamplerate
-VERSION=0.1.8
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
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}
PKG=$TMP/package-$PKGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -37,33 +38,47 @@ else
LIBDIRSUFFIX=""
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
-cd $PKGNAM-$VERSION
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
+sed -i "s|\$prefix/share/doc/libsamplerate0-dev/html|\$htmldir|g" configure
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
+ --htmldir=/usr/doc/$PKGNAM-$VERSION/html \
--disable-static \
--localstatedir=/var \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
make -j4 || exit 1
make install DESTDIR=$PKG || exit 1
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
-cp -a AUTHORS COPYING* NEWS README* doc/* $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a AUTHORS COPYING* NEWS README* $PKG/usr/doc/$PKGNAM-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc