2012-02-18 17:17:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Brad Hermanson <apeitheo@gmail.com>
|
|
|
|
|
|
|
|
PRGNAM=quakeforge
|
2012-09-23 17:22:46 +02:00
|
|
|
VERSION=0.7.0
|
2014-01-27 11:50:19 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2012-02-18 17:17:20 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -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
|
|
|
|
|
2014-01-27 11:50:19 +01:00
|
|
|
# Building with svga support break stuff on 32bit x86
|
|
|
|
SVGA="" ; [ "$ARCH" = "i486" ] && SVGA="--without-svga"
|
|
|
|
|
2012-02-18 17:17:20 +01:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
2012-09-23 17:22:46 +02:00
|
|
|
|
|
|
|
# A fix for version 0.7.0
|
|
|
|
rm -fR $CWD/$PRGNAM-$VERSION/tools/io_mesh_qfmdl
|
|
|
|
tar xvf $CWD/io_mesh_qfmdl-${VERSION}a.tar.bz2 -C $PRGNAM-$VERSION/tools/
|
|
|
|
|
2012-02-18 17:17:20 +01:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2013-12-30 03:08:48 +01:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
2014-01-27 11:50:19 +01:00
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
2013-12-30 03:08:48 +01:00
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2012-02-18 17:17:20 +01:00
|
|
|
|
2015-12-11 18:15:58 +01:00
|
|
|
CFLAGS="$SLKCFLAGS -fgnu89-inline" \
|
2012-05-05 02:02:52 +02:00
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2012-02-18 17:17:20 +01:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2012-05-05 02:02:52 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2012-02-18 17:17:20 +01:00
|
|
|
--mandir=/usr/man \
|
2012-05-05 02:02:52 +02:00
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
2014-01-27 11:50:19 +01:00
|
|
|
$SVGA \
|
2012-05-05 02:02:52 +02:00
|
|
|
--build=$ARCH-slackware-linux
|
2012-02-18 17:17:20 +01:00
|
|
|
|
2012-09-23 17:22:46 +02:00
|
|
|
# Parallel builds are broken
|
|
|
|
make -j1
|
2013-12-30 03:08:48 +01:00
|
|
|
make -j1 install DESTDIR=$PKG
|
2012-02-18 17:17:20 +01:00
|
|
|
|
2012-05-05 02:02:52 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2012-02-18 17:17:20 +01:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2012-05-05 02:02:52 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
2012-02-18 17:17:20 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
COPYING ChangeLog INSTALL NEWS TODO \
|
|
|
|
$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
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|