aboutsummaryrefslogtreecommitdiff
path: root/games/megaglest/megaglest.SlackBuild
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja@gmail.com>2013-12-01 09:05:06 +0100
committerRobby Workman <rworkman@slackbuilds.org>2013-12-02 00:58:03 -0600
commit2af9b17988fad0439c8e30c47f46b3a243b7857c (patch)
tree176cac55f1f39e34c7ae0b92f3dfa74067201da7 /games/megaglest/megaglest.SlackBuild
parentb00d17583d82f47b42f54fdc450c589898af1da9 (diff)
games/megaglest: Updated for version 3.9.0.4, added a license.
Cleanups and noted the optional dependency p7zip Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'games/megaglest/megaglest.SlackBuild')
-rw-r--r--games/megaglest/megaglest.SlackBuild48
1 files changed, 31 insertions, 17 deletions
diff --git a/games/megaglest/megaglest.SlackBuild b/games/megaglest/megaglest.SlackBuild
index 771703220c08f..b7c36a385303c 100644
--- a/games/megaglest/megaglest.SlackBuild
+++ b/games/megaglest/megaglest.SlackBuild
@@ -2,10 +2,29 @@
# Slackware build script for megaglest
-# Written by Larry Hajali <larryhaj[at]gmail[dot]com>
+# Copyright 2011-2013 Larry Hajali <larryhaj[at]gmail[dot]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=megaglest
-VERSION=${VERSION:-3.7.1}
+VERSION=${VERSION:-3.9.0.4}
+DATAVERSION=${DATAVERSION:-3.9.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -24,7 +43,7 @@ OUTPUT=${OUTPUT:-/tmp}
# Directory names don't always follow the $PRGNAM-$VERSION convention.
SRCDIR=$(tar -tf $CWD/$PRGNAM-source-$VERSION.tar.xz | head -1)
-DATADIR=$(tar -tf $CWD/$PRGNAM-data-$VERSION.tar.xz | head -1)
+DATADIR=$(tar -tf $CWD/$PRGNAM-data-$DATAVERSION.tar.xz | head -1)
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -47,10 +66,9 @@ mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCDIR
tar xvf $CWD/$PRGNAM-source-$VERSION.tar.xz
-tar xvf $CWD/$PRGNAM-source-embedded-$VERSION.tar.xz
-tar xvf $CWD/$PRGNAM-data-$VERSION.tar.xz -C $SRCDIR
+tar xvf $CWD/$PRGNAM-source-embedded-$DATAVERSION.tar.xz
+tar xvf $CWD/$PRGNAM-data-$DATAVERSION.tar.xz -C $SRCDIR
cd $SRCDIR
-find . -type l -exec rm -f '{}' \;
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -58,15 +76,11 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Fix version string.
-sed -i "/^const string glestVersionString/ s|=.*|= \"v${VERSION}\";|" \
- source/glest_game/facilities/game_util.cpp
-
# Fix megaglest help2man when no X display is available. Use a wrapper
-# script from upstream for Xvfb that create a temporary *fake* framebuffer
-install -m 0755 -D $CWD/xvfb-run $TMP/$SRCDIR/bin/xvfb-run
+# script from upstream for Xvfb that creates a temporary *fake* framebuffer
+install -D -m 0755 $CWD/xvfb-run $TMP/$SRCDIR/bin/xvfb-run
export PATH="$PATH:$TMP/$SRCDIR/bin"
-patch -p1 < $CWD/megaglest-3.6.0.2-help2man.patch
+patch -p1 < $CWD/megaglest-3.9.0-help2man.patch
mkdir build
cd build
@@ -80,8 +94,8 @@ cd build
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
- make install DESTDIR=$PKG
-cd ..
+ make -j1 install DESTDIR=$PKG
+cd -
# Now install the game data
cd $DATADIR
@@ -90,12 +104,12 @@ cd $DATADIR
-DCMAKE_BUILD_TYPE=Release .
make install DESTDIR=$PKG
-cd ..
+cd -
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-[ -d "$PKG/usr/man" ] && gzip -9 $PKG/usr/man/man?/*.?
+find $PKG/usr/man -type f -exec gzip -9 '{}' \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \