summaryrefslogtreecommitdiff
path: root/games/openttd/openttd.SlackBuild
diff options
context:
space:
mode:
authorChess Griffin <chess@chessgriffin.com>2010-04-21 21:32:01 -0500
committerErik Hanson <erik@slackbuilds.org>2010-05-15 10:38:40 +0200
commitf081a0df5d890cf3f0778bfd28c74c2b0d74667f (patch)
tree7e64bef82d870b647b6b79d48bc28b3f79a5a9dc /games/openttd/openttd.SlackBuild
parentb54b19de0c78a4d527be880c68f32c9c43284c45 (diff)
downloadslackbuilds-f081a0df5d890cf3f0778bfd28c74c2b0d74667f.tar.gz
games/openttd: Updated for version 1.0.0.
Can now use open source graphics, sounds, and music. Thanks to Chess Griffin.
Diffstat (limited to 'games/openttd/openttd.SlackBuild')
-rw-r--r--games/openttd/openttd.SlackBuild36
1 files changed, 32 insertions, 4 deletions
diff --git a/games/openttd/openttd.SlackBuild b/games/openttd/openttd.SlackBuild
index ff1199e7c8..94f9a2c321 100644
--- a/games/openttd/openttd.SlackBuild
+++ b/games/openttd/openttd.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for OpenTTD
-# Copyright 2007-2009 Chess Griffin <chess@chessgriffin.com>
+# Copyright 2007-2010 Chess Griffin <chess@chessgriffin.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,9 +23,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=openttd
-VERSION=${VERSION:-0.7.0}
+VERSION=${VERSION:-1.0.0}
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
@@ -33,6 +33,13 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+# If you want the script to use the open source graphics, sound, and music
+# data files (instead of the original Windows files), keep OPENDATA set to
+# YES. Otherwise, changing it to NO will not include the open source
+# graphics, sound, and music data files and you will need to manually copy
+# over the original Windows data files in order for OpenTTD to run.
+OPENDATA=${OPENDATA:-YES}
+
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
@@ -51,6 +58,12 @@ mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION-source.tar.bz2
+if [ "$OPENDATA" == "YES" ]; then
+ rm -rf opengfx-0.2.3 opensfx-0.2.3 openmsx-0.2.1
+ unzip -o $CWD/opengfx-0.2.3-all.zip
+ unzip -o $CWD/opensfx-0.2.3-all.zip
+ unzip -o $CWD/openmsx-0.2.1-all.zip
+fi
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
@@ -78,7 +91,7 @@ make install DEST_DIR=$PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
- xargs strip --strip-unneeded 2> /dev/null
+ xargs strip --strip-unneeded 2> /dev/null || true
)
( cd $PKG/usr/man
@@ -91,6 +104,21 @@ cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION
rm -f $PKG/usr/doc/$PRGNAM-$VERSION/openttd.6
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# Copy opengfx, opensfx, and openmsx files if OPENDATA=YES
+if [ "$OPENDATA" == "YES" ]; then
+ # First rename some text files to avoid name collisions when copied
+ rename .txt -opengfx.txt $TMP/opengfx-0.2.3/*
+ rename .txt -opensfx.txt $TMP/opensfx-0.2.3/*
+ rename .txt -openmsx.txt $TMP/openmsx-0.2.1/*
+ # Now copy the data files
+ cp -a $TMP/opengfx-0.2.3/* $PKG/usr/share/games/openttd/data/
+ cp -a $TMP/opensfx-0.2.3/* $PKG/usr/share/games/openttd/data/
+ cp -a $TMP/openmsx-0.2.1/* $PKG/usr/share/games/openttd/gm/
+ # These perms are needed
+ chmod 0644 $PKG/usr/share/games/openttd/data/*
+ chmod 0644 $PKG/usr/share/games/openttd/gm/*
+fi
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh