2013-11-23 15:18:36 +01:00
|
|
|
#!/bin/sh
|
2011-08-28 15:12:46 +02:00
|
|
|
|
|
|
|
# Slackware build script for zita-rev1
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
2013-01-02 02:30:21 +01:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2011-08-28 15:12:46 +02:00
|
|
|
PRGNAM=zita-rev1
|
2019-12-02 16:39:04 +01:00
|
|
|
VERSION=${VERSION:-0.2.2}
|
2011-08-28 15:12:46 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 10:59:26 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-08-28 15:12:46 +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:26 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-08-28 15:12:46 +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/usr/bin $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2019-12-02 16:39:04 +01:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2011-08-28 15:12:46 +02:00
|
|
|
|
2019-12-02 16:39:04 +01:00
|
|
|
sed -i 's,pkgconf,pkg-config,' source/Makefile
|
2011-08-28 15:12:46 +02:00
|
|
|
make -C source CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" PREFIX=/usr
|
|
|
|
make -C source install DESTDIR=$PKG PREFIX=/usr
|
|
|
|
strip $PKG/usr/bin/$PRGNAM
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2019-12-02 16:39:04 +01:00
|
|
|
cp -a AUTHORS COPYING doc/* $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-08-28 15:12:46 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/pixmaps
|
|
|
|
ln -s ../../doc/$PRGNAM-$VERSION/redzita.png $PKG/usr/share/pixmaps/$PRGNAM.png
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/applications
|
|
|
|
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
2019-12-02 16:39:04 +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-08-28 15:12:46 +02:00
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|