aboutsummaryrefslogtreecommitdiff
path: root/games/dopewars/dopewars.SlackBuild
diff options
context:
space:
mode:
authorFernando Giannasi <phoemur@gmail.com>2013-10-20 19:48:45 +0200
committerMatteo Bernardini <ponce@slackbuilds.org>2013-10-23 12:17:45 +0200
commit803008f8e927b15d1e9f63d43c8df8707422a33a (patch)
treee94a91c1bb6d43f47ea7be36917fd5464c494c2c /games/dopewars/dopewars.SlackBuild
parent16624b006987c1f337f33144f32e292e69357087 (diff)
games/dopewars: Added (Drug Dealing Game).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'games/dopewars/dopewars.SlackBuild')
-rw-r--r--games/dopewars/dopewars.SlackBuild105
1 files changed, 105 insertions, 0 deletions
diff --git a/games/dopewars/dopewars.SlackBuild b/games/dopewars/dopewars.SlackBuild
new file mode 100644
index 0000000000000..3ffeed440b59b
--- /dev/null
+++ b/games/dopewars/dopewars.SlackBuild
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# Slackware build script for dopewars
+
+# Copyright 2013 Fernando Giannasi <phoemur@gmail.com>
+# This work is free. You can redistribute it and/or modify it under
+# the terms of the WTFPL, Version 2, as published by Sam Hocevar.
+# See http://www.wtfpl.net/txt/copying/
+
+# Modified by the SlackBuilds.org project
+
+PRGNAM="dopewars"
+VERSION=${VERSION:-1.5.12}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# 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
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+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
+
+DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog COPYING"
+
+set -e # Exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man
+
+# Compile the application and install it into the $PKG directory
+make
+make install DESTDIR=$PKG
+
+# Strip binaries
+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
+
+# Compress manpages
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+# move the menu entry and the docs
+mkdir -p $PKG/usr/share/applications
+mv $PKG/usr/share/gnome/apps/Games/dopewars.desktop \
+ $PKG/usr/share/applications/$PRGNAM.desktop
+rm -fr $PKG/usr/share/gnome/apps/Games
+
+# Add documentation
+mkdir -p $PKG/usr/doc
+mv $PKG/usr/share/doc/$PRGNAM-$VERSION $PKG/usr/doc/
+rm -fr $PKG/usr/share/doc
+cp $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Copy the slack-desc and doisnt.sh
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+# Build the package
+cd "$PKG"
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}