aboutsummaryrefslogtreecommitdiff
path: root/games/chexquest/chexquest.SlackBuild
blob: 2f5835069505936ce1d3821b0540b72cc7a8d9dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash

# Slackware build script for chexquest

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# VERSION is taken from the timestamp of chex.wad in cqdos.zip. There
# will never be a new version of this...

# The download site http://www.doomlegends.com/chexquest/tucq.html is
# actually the homepage of a modified/combined version of Chex Quest 1 and 2,
# called "The Ultimate Chex Quest", but it also hosts the original
# games for download. I chose to package the originals, since the
# 'Ultimate' version isn't complete (missing at least one level).

# Icons came from: https://archive.org/details/chex_icon

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=chexquest
VERSION=${VERSION:-19960331}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch

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}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
# only unzip the .wad files, we don't need the rest.
unzip $CWD/cqdos.zip chex.wad
unzip -j -LL $CWD/cq2dos.zip '*/chex2.wad'
chown -R root:root .
chmod 644 *

DOOMDIR=$PKG/usr/share/games/doom
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
PKGBIN=$PKG/usr/games
DESKDIR=$PKG/usr/share/applications
OLDICON=$PKG/usr/share/pixmaps
mkdir -p $DOOMDIR $PKGDOC $PKGBIN $DESKDIR $OLDICON

cp -a chex.wad chex2.wad $DOOMDIR

install -m0755 -oroot -groot $CWD/chexquest.sh $PKGBIN/chexquest
ln -s chexquest $PKGBIN/chexquest2

for i in chexquest chexquest2; do
  cat $CWD/$i.desktop > $DESKDIR/$i.desktop
  for size in 16x16 22x22 32x32 48x48 64x64 128x128 256x256; do
    dir=$PKG/usr/share/icons/hicolor/$size/apps
    mkdir -p $dir
    convert -resize $size $CWD/$i.png $dir/$i.png
  done
  ln -s ../icons/hicolor/48x48/apps/$i.png $OLDICON/$i.png
done

# No docs in either zip file; include our own.
cat $CWD/README > $PKGDOC/README
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