summaryrefslogtreecommitdiff
path: root/games/openttd/openttd.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/openttd/openttd.SlackBuild')
-rw-r--r--games/openttd/openttd.SlackBuild50
1 files changed, 36 insertions, 14 deletions
diff --git a/games/openttd/openttd.SlackBuild b/games/openttd/openttd.SlackBuild
index d6496e8e5c..5626f983b8 100644
--- a/games/openttd/openttd.SlackBuild
+++ b/games/openttd/openttd.SlackBuild
@@ -2,12 +2,30 @@
# Slackware build script for OpenTTD
-# Written by Chess Griffin <chess@chessgriffin.com>
+# Copyright 2007-2009 Chess Griffin <chess@chessgriffin.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=openttd
-VERSION=0.6.3
+VERSION=${VERSION:-0.7.0}
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
CWD=$(pwd)
@@ -15,14 +33,15 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-DOCS="COPYING changelog.txt known-bugs.txt readme.txt docs/*"
-
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"
fi
set -e # Exit on most errors
@@ -47,6 +66,8 @@ CXXFLAGS="$SLKCFLAGS" \
--binary-dir=/games \
--data-dir=/share/games/openttd \
--icon-dir=/share/pixmaps \
+ --man-dir=/man/man6 \
+ --doc-dir=/doc/$PRGNAM-$VERSION \
--personal-dir=.openttd \
--install-dir=$PKG
@@ -54,21 +75,22 @@ make
make install DEST_DIR=$PKG
( cd $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
+ 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
)
-install -D -m 0644 $CWD/openttd.desktop \
- $PKG/usr/share/applications/openttd.desktop
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \;
+ for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
+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
-mkdir -p $PKG/usr/man/man6
-mv $PKG/usr/doc/$PRGNAM-$VERSION/openttd.6 $PKG/usr/man/man6/openttd.6
-gzip -9 $PKG/usr/man/man6/openttd.6
-
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh