slackbuilds_ponce/audio/horgand/horgand.SlackBuild
Heinz Wiesinger 7f26b9929f
All: SlackBuilds run in the directory they are in
Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-07-05 16:01:32 +07:00

108 lines
2.8 KiB
Bash

#!/bin/bash
# Slackware build script for horgand
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20200117 bkw: fix default audio device, add startup info to README
# 20151126 bkw: fix build on -current (preparing for 14.2)
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=horgand
VERSION=${VERSION:-1.14}
BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
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 [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
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 .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# Slackware's extra/fltk doesn't have /usr/include/Fl -> FL
sed -i '/#include/s,Fl/,FL/,' src/*
# 20200117 bkw: fix default alsa device. plughw:0,0 doesn't exist on
# Slackware by default, which prevents the app from starting up for the
# first time to allow the user to pick a device which *does* exist.
# See README.
sed -i 's|plughw:0,0|default|' src/organAudioOut.C
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--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
find $PKG/usr/man -type f -exec gzip -9 {} \;
# .desktop file borrowed from Debian package, with thanks.
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
mkdir -p $PKG/usr/share/pixmaps
cat src/${PRGNAM}128.xpm > $PKG/usr/share/pixmaps/$PRGNAM.xpm
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS COPYING ChangeLog NEWS README \
$PKG/usr/doc/$PRGNAM-$VERSION
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
# 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
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}