slackbuilds_ponce/libraries/libsndfile/libsndfile.SlackBuild

95 lines
2.6 KiB
Text
Raw Normal View History

2010-05-11 14:56:21 +02:00
#!/bin/sh
### libsndfile.SlackBuild ###
# Slackware build script for libsndfile 1.0.17
# Copyright (C) 2006 paul wisehart wise@lupulin.net
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Modified by Eric Hameleers
# - apply a patch if compiling against FLAC > 1.1.2
PRGNAM=libsndfile
2010-05-11 14:56:21 +02:00
VERSION=1.0.17
ARCH=${ARCH:-i486}
BUILD=${BUILD:-2}
2010-05-11 14:56:21 +02:00
TAG=${TAG:-_SBo}
CWD=$(pwd)
2010-05-11 14:56:21 +02:00
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
2010-05-11 14:56:21 +02:00
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
2010-05-11 14:56:21 +02:00
fi
set -e
2010-05-11 14:56:21 +02:00
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar -xvzf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
# Apply patch for flac > 1.1.2 where the API changed:
if [ $(flac -v | cut -f2 -d' ' | tr -d '.') -gt 112 ]; then
patch -p1 < $CWD/${PRGNAM}_flac.patch || exit 1
fi
2010-05-11 14:56:21 +02:00
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--htmldir=/usr/doc/$PRGNAM-$VERSION/html \
--enable-static=no \
--build=$ARCH-slackware-linux \
--host=$ARCH-slackware-linux
2010-05-11 14:56:21 +02:00
make
make install DESTDIR=$PKG
2010-05-11 14:56:21 +02:00
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
2010-05-11 14:56:21 +02:00
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-11 14:56:21 +02:00
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \
$PKG/usr/doc/$PRGNAM-$VERSION
2010-05-11 14:56:21 +02:00
# The --htmldir switch isn't working as of version 1.0.17
mv $PKG/usr/share/doc/libsndfile1-dev/html/ $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-11 14:56:21 +02:00
rm -rf $PKG/usr/share/doc
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
2010-05-11 14:56:21 +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
2010-05-11 14:56:21 +02:00
)
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