summaryrefslogtreecommitdiff
path: root/games/clonekeen/clonekeen.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/clonekeen/clonekeen.SlackBuild')
-rw-r--r--games/clonekeen/clonekeen.SlackBuild33
1 files changed, 15 insertions, 18 deletions
diff --git a/games/clonekeen/clonekeen.SlackBuild b/games/clonekeen/clonekeen.SlackBuild
index 209a5cd07d..ac178a730b 100644
--- a/games/clonekeen/clonekeen.SlackBuild
+++ b/games/clonekeen/clonekeen.SlackBuild
@@ -1,20 +1,18 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for clonekeen
# Written by B. Watson (yalhcru@gmail.com)
PRGNAM=clonekeen
-VERSION=${VERSION:-8.3}
+VERSION=${VERSION:-8.4}
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
@@ -26,29 +24,23 @@ 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
set -e
-SRCVER=$( echo $VERSION | sed 's/\.//g' )
SRCDIR=keen
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCDIR
-unzip $CWD/CKBeta${SRCVER}_Bin_W32.zip
-unzip -o $CWD/CKBeta${SRCVER}_Src.zip
+tar xvf $CWD/$PRGNAM-src-${VERSION/./}.tar.gz
cd $SRCDIR
chown -R root:root .
find . \
@@ -57,24 +49,26 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# See patch.txt for details on what this patch does and why.
-patch -p1 < $CWD/slackbuild.diff
+# Makefile doesn't use CFLAGS, ugh
+sed -i "/gcc/s/-O2/$SLKCFLAGS/" src/Makefile
# Ugh. The src tarball ships with compiled .o files!
-make -f Makefile.lnx -C src clean all CFLAGS="$SLKCFLAGS"
+rm -f platform/*.o
+
+make -C src
# Manual install
-mkdir -p $PKG/usr/games $PKG/usr/share/games/$PRGNAM/data
+mkdir -p $PKG/usr/games $PKG/usr/share/games/$PRGNAM
install -m0755 -s src/keen $PKG/usr/games/$PRGNAM-bin
install -m0755 -oroot -groot $CWD/$PRGNAM.sh $PKG/usr/games/$PRGNAM
ln -sf $PRGNAM $PKG/usr/games/keen
-install -m0644 bin/*.{DAT,dat} $PKG/usr/share/games/$PRGNAM
-install -m0644 bin/data/* $PKG/usr/share/games/$PRGNAM/data
+mv bin/keen.conf bin/keen.conf.default
+cp -r bin/* $PKG/usr/share/games/$PRGNAM
# story.txt is an ASCII-only version of storytxt.ck1 from the
# shareware release
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp $CWD/story.txt readme.txt $PKG/usr/doc/$PRGNAM-$VERSION
+cp $CWD/story.txt README src/*.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Optional shareware data. It's compressed in an oddball format,
@@ -91,6 +85,9 @@ if [ -e $CWD/1keen.zip ]; then
cd -
fi
+# Fix line endings of doc files
+sed -i 's/\r//' $PKG/usr/doc/$PRGNAM-$VERSION/*
+
mkdir -p $PKG/usr/man/man6
gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
ln -sf $PRGNAM.6.gz $PKG/usr/man/man6/keen.6.gz