2011-07-11 05:12:03 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for jack-keyboard
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
2013-01-02 02:30:15 +01:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2017-02-18 17:51:09 +01:00
|
|
|
# 20170218 bkw:
|
|
|
|
# - Make lash optional.
|
|
|
|
|
2017-02-16 22:42:29 +01:00
|
|
|
# 20170216 bkw:
|
|
|
|
# - Updated for v2.7.1. Apparently, upstream released 2.7.1 in 2012, but
|
|
|
|
# never got around to updating their web page, which still says that
|
|
|
|
# 2.5 is the latest release. It took me this long (5 years!) to notice
|
|
|
|
# there was a newer version on their sourceforge download page. Note
|
|
|
|
# that 2.5 used autotools but 2.7.1 uses cmake, so this script can no
|
|
|
|
# longer be used to build the old version.
|
|
|
|
# - Add capability stuff.
|
|
|
|
|
2011-07-11 05:12:03 +02:00
|
|
|
PRGNAM=jack-keyboard
|
2017-02-16 22:42:29 +01:00
|
|
|
VERSION=${VERSION:-2.7.1}
|
2011-07-11 05:12:03 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 10:59:08 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-07-11 05:12:03 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-19 10:59:08 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-07-11 05:12:03 +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=""
|
|
|
|
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-07-11 05:12:03 +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 {} \;
|
|
|
|
|
2017-02-18 17:51:09 +01:00
|
|
|
case "${LASH:-auto}" in
|
|
|
|
auto)
|
|
|
|
if pkg-config --exists lash-1.0; then
|
|
|
|
LASHOPT="ON"
|
|
|
|
else
|
|
|
|
LASHOPT="OFF"
|
|
|
|
fi ;;
|
|
|
|
y*|Y*|t*|T*|on|ON|1)
|
|
|
|
LASHOPT="ON" ;;
|
|
|
|
*) LASHOPT="OFF" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "LASHOPT=\"$LASHOPT\""
|
|
|
|
|
2017-02-16 22:42:29 +01:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
|
|
|
|
-DMAN_INSTALL_DIR=/usr/man \
|
2017-02-18 17:51:09 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=Release .. \
|
|
|
|
-DLashEnable=$LASHOPT
|
2017-02-16 22:42:29 +01:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
2011-07-11 05:12:03 +02:00
|
|
|
|
|
|
|
make
|
2017-02-16 22:42:29 +01:00
|
|
|
make install DESTDIR=$PKG
|
2011-07-11 05:12:03 +02:00
|
|
|
|
2017-02-16 22:42:29 +01:00
|
|
|
strip $PKG/usr/bin/$PRGNAM
|
2011-07-11 05:12:03 +02:00
|
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2017-02-16 22:42:29 +01:00
|
|
|
cp -a AUTHORS COPYING NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-07-11 05:12:03 +02: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
|
|
|
|
|
2017-02-16 22:42:29 +01: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/$PRGNAM
|
|
|
|
chmod 0750 $PKG/usr/bin/$PRGNAM
|
|
|
|
fi
|
|
|
|
|
2011-07-11 05:12:03 +02:00
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|