2010-06-14 08:37:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Modified by the SlackBuilds.org project
|
2011-01-24 06:43:20 +01:00
|
|
|
# Maintained by Alex Word <alex_word86@yahoo.com>
|
2010-06-14 08:37:16 +02:00
|
|
|
|
|
|
|
PRGNAM=xmoto
|
2012-08-10 07:13:06 +02:00
|
|
|
VERSION=${VERSION:-0.5.10}
|
2014-02-17 10:01:45 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2010-06-14 08:37:16 +02: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)
|
2011-01-24 06:43:20 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2010-06-14 08:37:16 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
2011-01-24 06:43:20 +01:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
2010-06-14 08:37:16 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG $TMP/$PRGNAM-$VERSION
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-25 12:23:31 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-06-14 08:37:16 +02:00
|
|
|
|
2012-08-10 07:13:06 +02:00
|
|
|
patch -p1 < $CWD/gcc-4.7.patch
|
|
|
|
|
2014-02-17 10:01:45 +01:00
|
|
|
CFLAGS="$SLKCFLAGS -DdDOUBLE" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS -DdDOUBLE" \
|
2012-08-10 07:13:06 +02:00
|
|
|
LDFLAGS="-ldl" \
|
2010-06-14 08:37:16 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2012-08-10 07:13:06 +02:00
|
|
|
--bindir=/usr/games \
|
2010-06-14 08:37:16 +02:00
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--localedir=/usr/share/locale \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--with-localesdir=/usr/share/locale \
|
|
|
|
--disable-dependency-tracking \
|
|
|
|
--enable-threads=posix \
|
|
|
|
--with-asian-ttf-file="/usr/share/fonts/TTF/wqy-zenhei.ttc" \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/{pixmaps,applications}
|
2012-08-10 07:13:06 +02:00
|
|
|
install -m 0644 extra/$PRGNAM.xpm $PKG/usr/share/pixmaps
|
|
|
|
install -m 0644 extra/$PRGNAM.desktop $PKG/usr/share/applications
|
|
|
|
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
2010-06-14 08:37:16 +02:00
|
|
|
|
2012-08-10 07:13:06 +02:00
|
|
|
# Don't include fonts that are already shipped with Slackware.
|
|
|
|
for i in $PKG/usr/share/$PRGNAM/Textures/Fonts/*.ttf; do
|
|
|
|
rm -f $i
|
|
|
|
ln -s $(find /usr/share/fonts -name $(basename $i)) $i
|
|
|
|
done
|
2010-06-14 08:37:16 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
2012-08-10 07:13:06 +02:00
|
|
|
AUTHORS COPYING NEWS README TODO ChangeLog \
|
2010-06-14 08:37:16 +02:00
|
|
|
$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
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|