summaryrefslogtreecommitdiffstats
path: root/games/bstone/bstone.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/bstone/bstone.SlackBuild')
-rw-r--r--games/bstone/bstone.SlackBuild69
1 files changed, 48 insertions, 21 deletions
diff --git a/games/bstone/bstone.SlackBuild b/games/bstone/bstone.SlackBuild
index da7b326267..1c518cdd88 100644
--- a/games/bstone/bstone.SlackBuild
+++ b/games/bstone/bstone.SlackBuild
@@ -1,21 +1,38 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for bstone
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
-# 20170921 bkw: update for v1.1.9.
+# 20230111 bkw: update for v1.2.12.
-# 20170807 bkw: update for v1.1.8, use upstream's icon instead of mine.
+# 20211004 bkw:
+# - update for v1.2.11.
+# - include .txt version of license.
+# - datadir.diff changed again.
+# - update .desktop file.
+# - better README doc on how to play the full version.
+# 20201219 bkw: update for v1.2.9.
+# 20200804 bkw: update for v1.2.8. datadir.diff changed again.
+# 20200222 bkw: update for v1.1.16_2.
+# 20191127 bkw: update for v1.1.14. datadir.diff had to change so we can't
+# build old versions any more.
+# 20170921 bkw: update for v1.1.9.
+# 20170807 bkw: update for v1.1.8, use upstream's icon instead of mine.
# 20170621 bkw: fix build on -current
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=bstone
-VERSION=${VERSION:-1.1.9}
+VERSION=${VERSION:-1.2.12}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+SRCVER=${VERSION/_/-}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -25,7 +42,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -49,15 +70,12 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz
-cd $PRGNAM-$VERSION
+rm -rf $PRGNAM-$SRCVER
+tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
+cd $PRGNAM-$SRCVER
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# look in /usr/share/games/bstone for game data files, not the
# directory the executable lives in. the --data_dir option can
@@ -66,7 +84,8 @@ patch -p1 < $CWD/datadir.diff
# make install and install/strip are borked, do manual install.
# always include the shareware data in the package, the game will
-# only use it if the user hasn't installed the full version.
+# automatically use it if the user hasn't installed the full version,
+# or offer a choice of full version or shareware if he has both.
mkdir -p build
cd build
cmake \
@@ -75,11 +94,11 @@ cd build
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-DMAN_INSTALL_DIR=/usr/man \
- -DCMAKE_BUILD_TYPE=Release ../src
+ -DCMAKE_BUILD_TYPE=Release ..
make
mkdir -p $PKG/usr/games $PKG/usr/share/games/$PRGNAM
- install -s -m0755 $PRGNAM $PKG/usr/games
+ install -s -m0755 src/$PRGNAM $PKG/usr/games
unzip $CWD/1bs30.zip
unzip BSSW30.SHR \*.BS1
@@ -93,13 +112,21 @@ cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE README.md *.doc src/bstone_todo.txt $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# the original source code license is supplied only as a MS word .doc
+# file. we ship it as-is, but rename it to something without spaces in
+# the filename. also, ship a pre-converted text version (created with
+# wvText, then hand-edited to fix the formatting).
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+LIC=blake_stone_source_code_license
+mkdir -p $PKGDOC
+cp -a LICENSE README.md TODO.md CHANGE* $PKGDOC
+cp -a *.doc $PKGDOC/$LIC.doc
+cat $CWD/$LIC.txt > $PKGDOC/$LIC.txt
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE