2010-05-12 23:29:35 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for toga2
|
|
|
|
|
|
|
|
# Written by Marco Pessotto <melmothx@gmail.com>
|
|
|
|
|
|
|
|
PRGNAM=toga2
|
|
|
|
VERSION=${VERSION:-141SE_posix}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:04:50 +02:00
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-12 23:29:35 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:27:19 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:35 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:27:19 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:35 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:27:19 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:04:50 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:35 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
mkdir -p $PRGNAM-$VERSION
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd src # weird tarball
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
chown -R root:root .
|
|
|
|
|
|
|
|
make CXXFLAGS="-pipe $SLKCFLAGS \
|
|
|
|
-fno-exceptions -fno-rtti -Wall \
|
|
|
|
-fstrict-aliasing -fomit-frame-pointer"
|
|
|
|
strip --strip-unneeded $PRGNAM
|
|
|
|
mkdir -p $PKG/usr/games
|
|
|
|
cp $PRGNAM $PKG/usr/games
|
|
|
|
|
|
|
|
## Add the manpage (Thanks to Debian)
|
|
|
|
mkdir -p $PKG/usr/man/man6
|
|
|
|
cat $CWD/$PRGNAM.6.gz > $PKG/usr/man/man6/$PRGNAM.6.gz
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
CHANGELOG COPYING copying.txt LICENSE readme.txt \
|
|
|
|
$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
|
2010-05-13 00:27:19 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|