2011-12-11 20:39:21 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for muse
|
|
|
|
|
|
|
|
# Written by Felix Pfeifer pfeifer[dot]felix[at]googlemail[dot]com
|
|
|
|
|
2020-04-16 07:55:11 +02:00
|
|
|
# 20200416 bkw: Modified by the SlackBuilds.org project
|
|
|
|
# - updated for v3.1
|
|
|
|
# - don't install docs in /usr/share/doc
|
|
|
|
# - add realtime capability support
|
|
|
|
|
2011-12-11 20:39:21 +01:00
|
|
|
PRGNAM=muse
|
2020-11-27 19:38:09 +01:00
|
|
|
VERSION=${VERSION:-3.1.1}
|
2014-10-07 18:59:02 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2011-12-11 20:39:21 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2020-04-16 07:55:11 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-12-11 20:39:21 +01:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2020-04-16 07:55:11 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-12-11 20:39:21 +01: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=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2011-12-11 20:39:21 +01: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 {} \;
|
|
|
|
|
2020-11-27 19:38:09 +01:00
|
|
|
# Change the INSTALL_NAME or every path in the package is versioned
|
|
|
|
sed -e "s/muse-3.1/muse/" -i CMakeLists.txt
|
2020-04-14 01:40:16 +02:00
|
|
|
|
2012-09-13 18:30:08 +02:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
|
2019-03-14 00:50:49 +01:00
|
|
|
-DENABLE_PYTHON:STRING="OFF" \
|
2012-09-13 18:30:08 +02:00
|
|
|
-DCMAKE_BUILD_TYPE=Release ..
|
2013-11-22 08:34:22 +01:00
|
|
|
make
|
2012-09-13 18:30:08 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
2011-12-11 20:39:21 +01:00
|
|
|
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2012-09-13 18:30:08 +02:00
|
|
|
mv $PKG/usr/share/man $PKG/usr/man
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
2020-04-16 07:55:11 +02:00
|
|
|
mkdir -p $PKG/usr/doc
|
2020-11-27 19:38:09 +01:00
|
|
|
mv $PKG/usr/share/doc/$PRGNAM $PKG/usr/doc/$PRGNAM-$VERSION
|
2020-04-16 07:55:11 +02:00
|
|
|
rmdir $PKG/usr/share/doc
|
2011-12-11 20:39:21 +01:00
|
|
|
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
|
|
|
|
|
2020-04-16 07:55:11 +02:00
|
|
|
# Only add capability stuff if not disabled:
|
|
|
|
if [ "${SETCAP:-yes}" = "yes" ]; then
|
|
|
|
cat $CWD/setcap.sh >> $PKG/install/doinst.sh
|
|
|
|
# Only allow execution by audio group
|
|
|
|
chown root:audio $PKG/usr/bin/muse3
|
|
|
|
chmod 0750 $PKG/usr/bin/muse3
|
|
|
|
fi
|
|
|
|
|
2011-12-11 20:39:21 +01:00
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|