summaryrefslogtreecommitdiff
path: root/games/jfsw_registered_data
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-31 13:57:48 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-12-04 10:08:52 +0700
commit593104a258cb61c1a4c4f09ce22f5769f692defd (patch)
tree6d998dcc47a9284e6d8063bca62d767b97fd386f /games/jfsw_registered_data
parent917ade9beae874120745ed5ed80acd89d38e3e96 (diff)
downloadslackbuilds-593104a258cb61c1a4c4f09ce22f5769f692defd.tar.gz
games/jfsw_registered_data: Add ogg quality option.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/jfsw_registered_data')
-rw-r--r--games/jfsw_registered_data/README7
-rw-r--r--games/jfsw_registered_data/extract-shadow-warrior.sh2
-rw-r--r--games/jfsw_registered_data/jfsw_registered_data.SlackBuild53
3 files changed, 30 insertions, 32 deletions
diff --git a/games/jfsw_registered_data/README b/games/jfsw_registered_data/README
index af00313be9..06810a1b55 100644
--- a/games/jfsw_registered_data/README
+++ b/games/jfsw_registered_data/README
@@ -19,4 +19,9 @@ need to install both on the same system, although this is supported.
While the package is being built, up to 1GB of space in /tmp (or $TMP)
will be used.
-See also: games/jfsw_wanton_destruction
+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
index 40d161fe84..2dc2b4e667 100644
--- a/games/jfsw_registered_data/extract-shadow-warrior.sh
+++ b/games/jfsw_registered_data/extract-shadow-warrior.sh
@@ -66,6 +66,6 @@ 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 7 track??.wav && rm -f track??.wav
+ [ -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 ee2335e04f..78008a385f 100644
--- a/games/jfsw_registered_data/jfsw_registered_data.SlackBuild
+++ b/games/jfsw_registered_data/jfsw_registered_data.SlackBuild
@@ -10,6 +10,11 @@
# 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
@@ -19,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=jfsw_registered_data
VERSION=${VERSION:-1.2}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -30,9 +35,7 @@ ZIPNAME1="$SRCNAM.zip"
ZIPNAME2="Shadow%20Warrior%20%28USA%29.zip"
ARCH=noarch
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
+
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -62,36 +65,26 @@ chmod 644 *
# can possibly make use of it. In fact it's been tested on MacOSX :)
sh $CWD/extract-shadow-warrior.sh "$SRCNAM.cue"
-# Loop mount the iso to extract the stuff we need from it.
-# N.B. sandbox wrappers like sbrun or slackrepo might complain that
-# /etc/mtab has been modified. We could prevent this by using the
-# --no-mtab option with the mount and umount commands below, but
-# if something makes the script die before it's finished, we would
-# have left behind an invisible mount that could cause confusion and
-# irritation later...
-MNTPNT="$( mktemp -d cdmount.XXXXXX )"
-mount -o loop track01.iso $MNTPNT
-
-cd $MNTPNT/swinst
- mkdir -p $PKG/usr/share/games/jfsw
- install -m0644 SW.GRP $PKG/usr/share/games/jfsw/sw_registered.grp
-
- mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
- for i in CREDITS.TXT license.txt; do
- sed 's,\r,,' < $i > $PKG/usr/doc/$PRGNAM-$VERSION/$( echo $i | tr A-Z a-z )
- done
-cd -
-
-cat $MNTPNT/sw.ico > $PKG/usr/doc/$PRGNAM-$VERSION/sw.ico
-umount $MNTPNT
-rmdir $MNTPNT
+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
+
+chmod 644 $PKGDOC/*
+sed -i 's,\r,,' $PKGDOC/*.txt
# Done with the iso, now for the audio tracks (which have already been
# converted to ogg).
-mkdir -p $PKG/usr/share/games/jfsw
-cp track??.ogg $PKG/usr/share/games/jfsw
+cp track??.ogg $GAMEDIR
-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