summaryrefslogtreecommitdiffstats
path: root/games/jfsw_registered_data
diff options
context:
space:
mode:
Diffstat (limited to 'games/jfsw_registered_data')
-rw-r--r--games/jfsw_registered_data/README24
-rw-r--r--games/jfsw_registered_data/extract-shadow-warrior.sh71
-rw-r--r--games/jfsw_registered_data/jfsw_registered_data.SlackBuild84
-rw-r--r--games/jfsw_registered_data/jfsw_registered_data.info10
4 files changed, 151 insertions, 38 deletions
diff --git a/games/jfsw_registered_data/README b/games/jfsw_registered_data/README
index 67e0da1b9d..06810a1b55 100644
--- a/games/jfsw_registered_data/README
+++ b/games/jfsw_registered_data/README
@@ -1,7 +1,9 @@
jfsw_registered_data (game data from full version of Shadow Warrior)
This is the full/registered version of Shadow Warrior, for use with the
-jfsw game engine.
+jfsw game engine. The package includes the resource file (sw.grp) and
+the audio tracks from the original CD, converted to .ogg for use with
+the jfsw engine.
Shadow Warrior is a first-person shooter video game developed by 3D
Realms and published by GT Interactive Software. The shareware version
@@ -9,13 +11,17 @@ was released for the PC on May 13, 1997, while the full version was
released on August 31, 1997. Shadow Warrior was developed using Ken
Silverman's Build engine.
-The jfsw launcher supports both the demo version (jfsw_demo_data) and the
-full version (jfsw_registered_data). Since the full version includes the
-levels from the demo version (as Episode 1), there's no need to install
-both on the same system, although this is supported.
+The jfsw launcher supports both the demo version (jfsw_demo_data)
+and the full version (jfsw_registered_data). Since the full version
+includes the levels from the demo version (as Episode 1), there's no
+need to install both on the same system, although this is supported.
-If you get '403 Forbidden' when downloading the source file, either
-use a browser to visit the homepage and click on 'Download Full', or
-else use a custom User-Agent header. Example:
+While the package is being built, up to 1GB of space in /tmp (or $TMP)
+will be used.
-( source jfsw_registered_data.info ; wget --user-agent Firefox $DOWNLOAD )
+The .ogg files are encoded with oggenc, with the -q (quality) option
+set to 7 by default. If you want, you can change the quality setting
+by exporting OGGQUAL=<number> in the environment (see the -q option in
+oggenc's man page for an explanation).
+
+See also: jfsw_hires_pack, jfsw_wanton_destruction, jfsw_twin_dragon
diff --git a/games/jfsw_registered_data/extract-shadow-warrior.sh b/games/jfsw_registered_data/extract-shadow-warrior.sh
new file mode 100644
index 0000000000..c8f3651275
--- /dev/null
+++ b/games/jfsw_registered_data/extract-shadow-warrior.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# extract-shadow-warrior.sh, by B. Watson (urchlay@slackware.uk).
+
+# Licensed under the WTFPL: Do WTF you want with this. See
+# http://www.wtfpl.net/txt/copying/ for details.
+
+# This file is part of the SlackBuilds.org jfsw_registered_data build,
+# but you're welcome to use it for any other purpose (that's why I made
+# it a standalone script).
+
+# Extracts the game data from bin/cue of Shadow Warrior for DOS, as found
+# in the zip file from https://archive.org/details/ShadowWarriorUSA. The
+# tool that handles bin/cue files is bchunk, but sadly it doesn't properly
+# handle bin/cue where each track is in a separate bin file... so we
+# help it along by chopping up the .cue file.
+
+# We expect a single argument: the name of the .cue file. Output will be
+# a set of .iso and .wav files in the current directory, named track01.iso
+# and track02.wav through track14.wav, plus a set of converted track02.ogg
+# through track14.ogg, if the oggenc command is found on $PATH.
+
+# When we're finished, the files will take up around 900MB of space,
+# so plan accordingly.
+
+# Note: converting the same wav file to ogg with oggenc multiple times,
+# does not give identical ogg files. It *does* however give the same
+# sized file every time (down to the byte). Really only matters if you're
+# debugging this script, I guess.
+
+if [ "$*" = "" ] || [ ! -e "$1" ]; then
+ echo "Usage: $( basename $0 ) cue-file.cue" 1>&2
+ exit 1
+fi
+
+# need this to let "read" read the initial spaces in the .cue file lines
+IFS=""
+
+# save old stdout
+exec 3>&1
+
+# clean up any turds from previous runs
+rm -f tmpcue??.cue
+
+# split up each track entry in the input .cue file into a separate .cue
+# file containing only that track.
+count=1
+cat "$1" | while read line; do
+ case "$line" in
+ FILE*) cue_out="tmpcue$( printf '%02d' $count ).cue"
+ exec > "$cue_out"
+ count="$( expr $count + 1 )"
+ ;;
+ esac
+ echo "$line"
+done
+
+# restore old stdout
+exec 1>&3
+
+# now convert each file to .iso or .wav (bchunk is smart enough
+# to know which is which). if a file is a .wav, we'll convert it
+# to .ogg and delete it, so we don't end up chewing up 1.3GB of
+# disk space all at once.
+for cue_out in tmpcue??.cue; do
+ rm -f track??.wav
+ binfile="$( head -1 "$cue_out" | cut -d\" -f2 )"
+ bchunk -w "$binfile" "$cue_out" track
+ [ -e track??.wav ] && oggenc -q ${OGGQUAL:-7} track??.wav && rm -f track??.wav
+ rm -f $cue_out
+done
diff --git a/games/jfsw_registered_data/jfsw_registered_data.SlackBuild b/games/jfsw_registered_data/jfsw_registered_data.SlackBuild
index 756d31d89c..04dbe21d91 100644
--- a/games/jfsw_registered_data/jfsw_registered_data.SlackBuild
+++ b/games/jfsw_registered_data/jfsw_registered_data.SlackBuild
@@ -1,21 +1,46 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for jfsw_registered_data
-# 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.
-# This game is offered as a free download on both Steam and GoG.
-# It's also been available from www.oldpcgaming.net since 2014.
+# This game is offered as a free download on both Steam and GoG. It also
+# was available from www.oldpcgaming.net from 2014 to late 2019, and
+# has been available on archive.org since late 2018.
+
+# 20211031 bkw: BUILD=3
+# - use iso-read to extract files from the iso, rather than loop-mounting.
+# - CREDITS.TXT => credits.txt.
+# - add OGGQUAL option.
+
+# 20200428 bkw: the old .7z from oldpcgaming.net has vanished along
+# with the site. Switched to a CD image from archive.org, in bin/cue
+# format. More work for this script to do, but as a nice bonus, we get
+# the CD audio tracks installed too.
+
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=jfsw_registered_data
VERSION=${VERSION:-1.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+# Depending on what was used to do the download, the %XX hex escapes
+# might get interpreted or not, handle either name.
+SRCNAM="Shadow Warrior (USA)"
+ZIPNAME1="$SRCNAM.zip"
+ZIPNAME2="Shadow%20Warrior%20%28USA%29.zip"
ARCH=noarch
-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}
@@ -28,31 +53,42 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
-7za x $CWD/shadow.7z '*/*.GRP' '*/*.TXT' '*/*.ICO'
-cd shadow
+
+[ -e "$CWD/$ZIPNAME1" ] && ZIPNAME="$ZIPNAME1" || ZIPNAME="$ZIPNAME2"
+unzip "$CWD/$ZIPNAME"
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 {} \+
+chmod 644 *
+
+# The "source" file is a bin/cue cdrom image with multiple .bin files.
+# It took some effort to get bchunk to extract this correctly, and I've
+# moved the code into a separate script so that users of other distros
+# can possibly make use of it. In fact it's been tested on MacOSX :)
+sh $CWD/extract-shadow-warrior.sh "$SRCNAM.cue"
+
+GAMEDIR=$PKG/usr/share/games/jfsw
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $GAMEDIR $PKGDOC
+
+# We just extracted an iso image, now extract files from it.
+# Rather than loop-mounting the iso to extract the files, use
+# iso-read (part of Slackware's libcdio package).
+iso-read -i track01.iso -e swinst/sw.grp -o $GAMEDIR/sw_registered.grp
+iso-read -i track01.iso -e swinst/credits.txt -o $PKGDOC/credits.txt
+iso-read -i track01.iso -e swinst/license.txt -o $PKGDOC/license.txt
+iso-read -i track01.iso -e sw.ico -o $PKGDOC/sw.ico
-mkdir -p $PKG/usr/share/games/jfsw
-install -m0644 SW.GRP $PKG/usr/share/games/jfsw/sw_registered.grp
+chmod 644 $PKGDOC/*
+sed -i 's,\r,,' $PKGDOC/*.txt
-# This stuff's not very relevant to a source port.
-rm -f INSTALL.TXT ORDERFRM.TXT
+# Done with the iso, now for the audio tracks (which have already been
+# converted to ogg).
+cp track??.ogg $GAMEDIR
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-for i in *.TXT; do
- sed 's,\r,,' < $i > $PKG/usr/doc/$PRGNAM-$VERSION/$( echo $i | tr A-Z a-z )
-done
-cat SW.ICO > $PKG/usr/doc/$PRGNAM-$VERSION/sw.ico
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+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
diff --git a/games/jfsw_registered_data/jfsw_registered_data.info b/games/jfsw_registered_data/jfsw_registered_data.info
index a5153d153a..4413fb7726 100644
--- a/games/jfsw_registered_data/jfsw_registered_data.info
+++ b/games/jfsw_registered_data/jfsw_registered_data.info
@@ -1,10 +1,10 @@
PRGNAM="jfsw_registered_data"
VERSION="1.2"
-HOMEPAGE="http://www.oldpcgaming.net/shadow-warrior-review/"
-DOWNLOAD="http://www.oldpcgaming.net/demo/shadow.7z"
-MD5SUM="b1dff182c5760710c2e31e9f4e728eb1"
+HOMEPAGE="https://archive.org/details/ShadowWarriorUSA"
+DOWNLOAD="https://archive.org/download/ShadowWarriorUSA/Shadow%20Warrior%20%28USA%29.zip"
+MD5SUM="b301a2f6929cdd7642b308b13d4bc69c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="jfsw p7zip"
+REQUIRES="jfsw bchunk"
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"