slackbuilds_ponce/audio/lingot/lingot.SlackBuild

105 lines
2.6 KiB
Text
Raw Normal View History

#!/bin/sh
2010-05-13 00:57:28 +02:00
# Slackware build script for lingot
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
2010-05-13 00:57:28 +02:00
PRGNAM=lingot
VERSION=${VERSION:-0.9.1}
2010-05-13 00:57:28 +02:00
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
2016-08-19 10:59:12 +02:00
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
2010-05-13 00:57:28 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
2016-08-19 10:59:12 +02:00
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
2010-05-13 00:57:28 +02:00
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=""
2010-05-13 00:57:28 +02:00
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
2010-05-13 00:57:28 +02:00
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
2010-05-13 00:57:28 +02:00
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Slackware doesn't set up the ALSA plughw:0 device by default, so make lingot
# use hw:0 as its default ALSA device.
sed -i 's,plug\(hw:0\),\1,g' README src/*.c
# Fix a format string error (unlikely but possible segfault/exploit),
# patch borrowed from Debian.
patch -p1 < $CWD/format_string.diff
2010-05-13 00:57:28 +02:00
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--enable-jack=${JACK:-yes} \
2010-05-13 00:57:28 +02:00
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
# man page from Debian
mkdir -p $PKG/usr/man/man1
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
2010-05-13 00:57:28 +02:00
# These are not documentation..
rm -f $PKG/usr/doc/$PRGNAM-$VERSION/intltool*
# At least one of the doc files is a zero-length placeholder.
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -a -size 0 -print0 | \
xargs -0 rm -f
2010-05-13 00:57:28 +02:00
# `make install' puts the docs in --docdir, just add the SlackBuild
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
if [ "${SETCAP:-yes}" = "yes" ]; then
cat $CWD/setcap.sh >> $PKG/install/doinst.sh
chown root:audio $PKG/usr/bin/$PRGNAM
chmod 0750 $PKG/usr/bin/$PRGNAM
fi
2010-05-13 00:57:28 +02:00
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}