summaryrefslogtreecommitdiff
path: root/games/jfsw_hires_pack/jfsw_hires_pack.SlackBuild
blob: 4efbd4ffc80612c05372f1ef0a472297e5e4e737 (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
#!/bin/bash

# Slackware build script for jfsw_hires_pack

# Written by B. Watson (yalhcru@gmail.com)

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

# 20211030 bkw: update for v20201205_r21.
# - source is now made from upstream SVN, see svn2tarxz.sh.
# - HRP works with shareware .grp now, get rid of warning.
# - use correct homepage.
# - fix CRLF endings in docs.
# - add README note about the truncated sword.

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

PRGNAM=jfsw_hires_pack
VERSION=${VERSION:-20201205_r21}
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

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 $PKG/usr/share/games $OUTPUT
cd $PKG/usr/share/games
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
mv $PRGNAM-$VERSION jfsw
cd jfsw
chown -R root:root .
find . -type f -exec chmod 644 {} \+
find . -type d -exec chmod 755 {} \+

rm -f *.bat

# jfsw will read <foo>.def whenever it loads <foo>.grp. it also
# always reads sw.def. so this seems to be the correct way to
# name these so they'll get auto-loaded.
mv tdragon.def td.def
mv wanton.def wd.def

# TODO: what about highres/skyboxes/Sky_Stars? Nothing in any of the
# .def files references it.

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
sed -i 's,\r,,' *.txt
mv *.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE