slackbuilds_ponce/audio/cardinal/cardinal.SlackBuild
Martin Bångens 96b2c8316c
audio/cardinal: Updated for version 24.05
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-06-04 09:20:40 +07:00

105 lines
3.1 KiB
Bash

#!/bin/bash
# Slackware build script for cardinal
# Copyright 2023 Martin Bångens Sweden
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=cardinal
VERSION=${VERSION:-24.05}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
set -e
rm -rf $PKG
LIBDIR=lib
if [ $ARCH == "x86_64" ]; then
LIBDIR="$LIBDIR"64
fi
mkdir -p $TMP $PKG $OUTPUT $PKG/$LIBDIR
cd $TMP
if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then
rm -rf Cardinal-linux-i686-$VERSION
mkdir Cardinal-linux-i686-$VERSION
cd Cardinal-linux-i686-$VERSION
tar xvf $CWD/Cardinal-linux-i686-$VERSION.tar.gz
elif [ "$ARCH" = "x86_64" ]; then
rm -rf Cardinal-linux-x86_64-$VERSION
mkdir Cardinal-linux-x86_64-$VERSION
cd Cardinal-linux-x86_64-$VERSION
tar xvf $CWD/Cardinal-linux-x86_64-$VERSION.tar.gz
else
echo "Unknown ARCH"
exit 1
fi
chown -R root:root .
mkdir -p $PKG/usr/$LIBDIR/clap
mkdir -p $PKG/usr/$LIBDIR/lv2
mkdir -p $PKG/usr/$LIBDIR/vst
mkdir -p $PKG/usr/$LIBDIR/vst3
mkdir -p $PKG/usr/bin
mv Cardinal.clap $PKG/usr/$LIBDIR/clap/
mv Cardinal.lv2 $PKG/usr/$LIBDIR/lv2/
mv Cardinal.vst $PKG/usr/$LIBDIR/vst/
mv Cardinal.vst3 $PKG/usr/$LIBDIR/vst3/
mv CardinalFX.lv2/ $PKG/usr/$LIBDIR/lv2/
mv CardinalFX.vst3/ $PKG/usr/$LIBDIR/vst3/
mv CardinalJACK $PKG/usr/bin/
mv CardinalMini.lv2/ $PKG/usr/$LIBDIR/lv2/
mv CardinalNative $PKG/usr/bin/
mv CardinalSynth.lv2/ $PKG/usr/$LIBDIR/lv2/
mv CardinalSynth.vst3/ $PKG/usr/$LIBDIR/vst3/
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
chown root:root LICENSE
cp -a \
LICENSE \
README.md \
docs/* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
rm -rf $PKG/$LIBDIR
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.$PKGTYPE