slackbuilds_ponce/audio/fmit/fmit.SlackBuild
B. Watson c23c4a4557
audio/fmit: New maintainer, fix issues.
Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-01-06 08:08:50 +07:00

101 lines
2.8 KiB
Bash

#!/bin/bash
# Slackware build script for fmit (Free Musical Instrument Tuner)
# Originally written by Josiah Boothby
# Modified and now maintained by B. Watson <urchlay@slackware.uk>
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20240103 bkw:
# - New maintainer.
# - Relicense as WTFPL with permission.
# - Add missing setcap.sh. This has been broken (by me) for 2 years,
# and nobody reported it...
# - Move the "=== CONFIG" message down, so it doesn't interfere
# with PRINT_PACKAGE_NAME.
# 20220218 bkw: Modified by SlackBuilds.org:
# - update for v1.2.14 (the old download disappeared).
# - autodetect jack and portaudio, instead of making the user manually
# set environment variables (can still disable with environment).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=fmit
VERSION=${VERSION:-1.2.14}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# 20220218 bkw: always include qt (aka PulseAudio) and ALSA support.
CONFIG="acs_qt acs_alsa"
# 20220218 bkw: autodetect jack and portaudio, allow disabling in env.
pkg-config --exists jack && \
[ "${JACK:-yes}" != "no" ] && \
CONFIG+=" acs_jack" && \
SETCAP="${SETCAP:-yes}"
pkg-config --exists portaudio-2.0 && \
[ "${PORTAUDIO:-yes}" != "no" ] && \
CONFIG+=" acs_portaudio"
# 20220218 bkw: build without OSS, allow enabling in env.
[ "${OSS:-no}" = "yes" ] && CONFIG+=" acs_oss"
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
echo "=== CONFIG='$CONFIG'"
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# 20220218 bkw: SLKCFLAGS and LIBDIRSUFFIX not needed (qmake uses
# the ones qt5 was compiled with, which is correct).
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 .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
qmake-qt5 PREFIX=/usr CONFIG+="$CONFIG"
make
make install INSTALL_ROOT=$PKG
# 20220218 bkw: binary already stripped.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING* README.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
sed "s,@CONFIG@,$CONFIG," < $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
if [ "$SETCAP" = "yes" ]; then
cat $CWD/setcap.sh >> $PKG/install/doinst.sh
chown root:audio $PKG/usr/bin/$PRGNAM
chmod 0750 $PKG/usr/bin/$PRGNAM
fi
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE